Skip to content

Instantly share code, notes, and snippets.

Avatar

whaison whaison

View GitHub Profile
View Sprites-Default-Additive.shader
Shader "Sprites/DefaultAdditive"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader
View mayapy.bat
set MayaWorkspace=%CD%
echo %MayaWorkspace%
set EscapedMayaWorkspace=%MayaWorkspace%
:: 置換
set old=:\
set new=//
call set EscapedMayaWorkspace=%%EscapedMayaWorkspace:%old%=%new%%%
set old=\
set new=/
call set EscapedMayaWorkspace=%%EscapedMayaWorkspace:%old%=%new%%%
@whaison
whaison / UnityCG.cginc
Created Mar 7, 2016
Unity5.3.2 UnityCG.cginc ///Applications/Unity/Unity.app/Contents/CGIncludes/UnityCG.cginc
View UnityCG.cginc
#ifndef UNITY_CG_INCLUDED
#define UNITY_CG_INCLUDED
#define UNITY_PI 3.14159265359f
#include "UnityShaderVariables.cginc"
uniform fixed4 unity_ColorSpaceGrey;
uniform fixed4 unity_ColorSpaceDouble;
uniform half4 unity_ColorSpaceDielectricSpec;
View DisplayAnimation.py
from fbx import *
#from samples.ImportScene.DisplayCommon import *
def DisplayString(pHeader, pValue="" , pSuffix=""):
lString = pHeader
lString += str(pValue)
lString += pSuffix
print(lString)
def DisplayBool(pHeader, pValue, pSuffix=""):
@whaison
whaison / FixMask.cs
Created May 4, 2016
FixMask.cs (Unity5.3.4p3)
View FixMask.cs
//saves you from agonizing manual clicking "Fix Mask" on each user-created clip,
//when you have updated/edited the original FBX changing the skeleton hierarchy
//drop this in your Scripts/Editor folder,
//select FBX's and right click context menu Fix Animation Masks
//reImporot Foloder
//tested on Unity 5.3.4p3
//minor update, sets all transforms of the avatarMask to active (assuming you are just using 'Mask Definition Create From This Model' with all transforms active (Default behavior)
@whaison
whaison / ModelAnimationSplitterWithAnimeControllerTrigger.cs
Created May 4, 2016
ModelAnimationSplitterWithAnimeControllerTrigger.cs
View ModelAnimationSplitterWithAnimeControllerTrigger.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
using UnityEditor.Animations;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
using System;
@whaison
whaison / CSharpReNameFileNameExtention_And_Meta.cs
Last active May 30, 2019
Unity AssetDatabase.RenameAsset(path, newName); can not rename extension CSharpReNameFileNameExtention_And_Meta(string path,string newName) can chenge extension
View CSharpReNameFileNameExtention_And_Meta.cs
static public void CSharpReNameFileNameExtention_And_Meta(string path,string newName)
{
string[] pathArr = path.Split("/"[0]);
string tempStr = "";
for (int i = 0; i < pathArr.Length-1; i++)
{
tempStr = tempStr + pathArr[i]+"/";
}
string renameDir = tempStr;
@whaison
whaison / FragmentWithSurface.shader
Last active Mar 25, 2019 — forked from shop-0761/FragmentWithSurface.shader
Fragment と surface を一緒に使うやつ
View FragmentWithSurface.shader
Shader "Custom/fragmentWithSurface" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }
@whaison
whaison / Maya.env
Created Nov 2, 2016
Maya.env     Dドライブにパス追加する設定 デフォルトは全部コメントアウトされてる。
View Maya.env
//PCの環境変数
//Path C:\Users\ゆーざ\AppDうata\Local\Programs\EmEditor;C:\Users\ゆーざ\AppData\Local\atom\bin
//TEMP %USERPROFILE%\AppData\Local\Temp
//TMP %USERPROFILE%\AppData\Local\Temp
//Mayaの環境変数 http://www.dfx.co.jp/dftalk/?p=72
// Share plugin
//MAYA_PLUG_IN_PATH=Z:\share\maya\version\plugins;Z:\usr\maya\version\plugins;
//知っていると便利かもしれない環境変数一覧
//書き方がわかったところで
//本題の知っていると便利かも知れない環境変数の一覧です。
View AnimationWindowExtends.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Reflection;