This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/mosaic" { | |
Properties | |
{ | |
//[PerRendererData] | |
_MainTex ("Texture", 2D) = "white" {} | |
_Width ("Image Width", Float) = 256 | |
_Height ("Image Height", Float) = 256 | |
_BlockWidth ("Block Width", Float) = 2 | |
_BlockHeight ("Block Height", Float) = 2 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( EditorUserBuildSettings.activeBuildTarget != BuildTarget.iPhone ){ | |
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iPhone); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using System; | |
void CopyToClipboard(string txt) | |
{ | |
// 代入するだけでクリップボードにコピーされる | |
// 何でも string 型にすれば、クリップボードにつっこめる。 | |
EditorGUIUtility.systemCopyBuffer = txt; 。 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
{ | |
// SortingLayer 名の取得 | |
var tagManager = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset")[0]); | |
var sortingLayer = tagManager.FindProperty("m_SortingLayers"); | |
for (int i = 0; i < sortingLayer.arraySize; ++i) { | |
string tag = sortingLayer.GetArrayElementAtIndex(i).displayName; | |
// TODO : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class AssetDatabaseHelper | |
{ | |
// Editor スクリプト : 指定パスに指定アセットを書き込む. ない場合は新規作成. | |
// AssetDatabase.CreateAsset() ですでにあるアセットを作成すると、管理IDが変わってしまうために参照切れ(missing)が起こる。 | |
void CreateAsset(Object newAsset,string path,System.Type type) | |
{ | |
var asset = AssetDatabase.LoadAssetAtPath(path,type); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |