Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
naojitaniguchi / ScrollTexture.cs
Created October 20, 2015 10:18
Scroll texture in Unity
using UnityEngine;
using System.Collections;
public class ScrollTexture : MonoBehaviour {
public float scrollSpeed = 0.0004f ;
private Mesh mesh ;
// Use this for initialization
void Start () {
mesh = GetComponent<MeshFilter>().mesh ;
@naojitaniguchi
naojitaniguchi / SplashImage.cs
Last active October 19, 2015 07:27
Splash screen script for Unity
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public enum Fade{ In, Out };
public class SplashImage : MonoBehaviour {
public float fadeTime = 1.0f ;
public int nextScene ;
@naojitaniguchi
naojitaniguchi / convert.bat
Created October 15, 2015 07:00
convert image sequence by image magic
convert frame*.tif -scene 1 frame%04d.png
@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/"
@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 / 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 / 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 / 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 / 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 / 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))