Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
naojitaniguchi / WireFrame.cs
Created April 20, 2015 02:30
WireFrame Rendering Script on Unity
using UnityEngine;
using System.Collections;
public class Wireframe : MonoBehaviour {
public Color lineColor;
public Color backgroundColor;
public bool ZWrite = true;
public bool AWrite = true;
public bool blend = true;
@naojitaniguchi
naojitaniguchi / VideoPicker.cs
Last active September 15, 2020 10:17
Video Picker for Unity iOS native plugin call sample, Using UIImagePickerController
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class VideoPicker : MonoBehaviour {
public Texture2D shareButtonImage; // Use this for initialization
[DllImport("__Internal")]
private static extern void OpenVideoPicker(string game_object_name, string function_name);
@naojitaniguchi
naojitaniguchi / SimpleBGMPlayer.cs
Created July 21, 2015 08:56
SimpleBGMPlayer for Unity
using UnityEngine;
using System.Collections;
public class SimpleBGMPlayer : MonoBehaviour {
// Use this for initialization
void Start () {
}
@naojitaniguchi
naojitaniguchi / question_paser.py
Created August 14, 2015 08:15
parsing XML and sorting by class member sample
__author__ = 'tani'
from xml.etree.ElementTree import *
from operator import itemgetter, attrgetter
class Question:
def __init__(self, delayTime, comment):
self.delayTime = delayTime
self.comment = comment
def __repr__(self):
return repr((self.delayTime, self.comment))
@naojitaniguchi
naojitaniguchi / SetUIPos.cs
Created September 30, 2015 07:35
Set UI Object position by corner and offset in Unity
using UnityEngine;
using System.Collections;
public class SetUIPos : MonoBehaviour {
public enum enumCorner { TopLeft, BottomLeft, TopRight, BottomRight };
public enumCorner coner;
public int offsetX;
public int offsetY;
// Use this for initialization
@naojitaniguchi
naojitaniguchi / CaptureScreen.cs
Created September 30, 2015 07:50
Scren Capture in UI Button in Unity
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class CaptureScreen : MonoBehaviour {
public string fileName;
// Use this for initialization
void Start () {
Button button = this.GetComponent<Button>();
@naojitaniguchi
naojitaniguchi / StandardDoubleSide.shader
Created October 8, 2015 02:54
Standerd Double sided shader for Unity
Shader "StandardDoubleSide"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
@naojitaniguchi
naojitaniguchi / SetRenderQueue.cs
Created October 8, 2015 06:03
Unity Script for set render queue , this script works at editor mode .
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class SetRenderQueue : MonoBehaviour {
public int rQueue;
// Use this for initialization
void Start () {
GetComponent<Renderer>().material.renderQueue = rQueue;
@naojitaniguchi
naojitaniguchi / move2image.bash
Created October 12, 2015 01:49
correct movie from smartphone vertical flip and make image sequence image from image by ffmpeg .
ffmpeg -i input.mp4 -metadata:s:v rotate="0" -vf "hflip,vflip" -c:v libx264 -crf 23 -acodec copy output.mp4
ffmpeg -i output.mp4 "out_%04d.jpg"
@naojitaniguchi
naojitaniguchi / pickup_and_copy.py
Created October 12, 2015 02:40
Select file from image sequence and rename copy to destination directory .
__author__ = 'tani'
import shutil
if __name__ == '__main__':
start = 1
end = 1324
step = 5
copy_from = "form/"
copy_to = "to/"