SlideShare a Scribd company logo
1 of 30
Download to read offline












public class Hierarchy : EditorWindow
{
public Dictionary<int, bool> foldouts = new Dictionary<int, bool>();
void OnGUI()
{
var id = 1;
foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent");
if (foldouts[id])
{
EditorGUI.indentLevel = 2;
EditorGUILayout.LabelField("Child");
}
}
}












public class Hierarchy : EditorWindow
{
public Dictionary<int, bool> foldouts = new Dictionary<int, bool>();
void OnGUI()
{
var id = 1;
foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent");
if (foldouts[id])
{
EditorGUI.indentLevel = 2;
EditorGUILayout.LabelField("Child");
}
}
}












public class Hierarchy : EditorWindow
{
public Dictionary<int, bool> foldouts = new Dictionary<int, bool>();
void OnGUI()
{
var id = 1;
foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent");
if (foldouts[id])
{
EditorGUI.indentLevel = 2;
EditorGUILayout.LabelField("Child");
}
}
}












protected override TreeViewItem BuildRoot ()
{
var root = new TreeViewItem {id = 0, depth = -1, displayName = "Root"};
var allItems = new List<TreeViewItem>
{
new TreeViewItem {id = 1, depth = 0, displayName = "Animals"},
new TreeViewItem {id = 2, depth = 1, displayName = "Mammals"},
new TreeViewItem {id = 3, depth = 2, displayName = "Tiger"},
new TreeViewItem {id = 7, depth = 1, displayName = "Reptiles"},
new TreeViewItem {id = 8, depth = 2, displayName = "Crocodile"},
new TreeViewItem {id = 9, depth = 2, displayName = "Lizard"},
};
return root;
}




😂














[MenuItem(“ ")]
static void Open()
{
//
BuildPipeline.BuildPlayer(options);
}










class MyCustomBuildProcessor : IPreprocessBuild
{
public void OnPreprocessBuild(BuildTarget target, string path)
{
Debug.Log(“ ”);
}
}
[ScriptedImporter(1, "cube")]
public class CubeImporter : ScriptedImporter
{
public float m_Scale = 1;
public override void OnImportAsset(AssetImportContext ctx)
{
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
var text = File.ReadAllText(ctx.assetPath);
var position = JsonUtility.FromJson<Vector3>(text);
cube.transform.position = position;
}
}












[CustomEditor(typeof(CubeImporter))]
public class CubeImporterEditor : ScriptedImporterEditor
{
}












[CustomEditor(typeof(Object))]
public class ObjectEditor : Editor
{
public ObjectEditor ()
{
if (extension == ".zip") {
editor = Editor.CreateEditor (Selection.activeObject,
typeof(ZipEditor));
} else if (string.IsNullOrEmpty (extension)) {
editor = Editor.CreateEditor (Selection.activeObject,
typeof(FolderEditor));
} else {
editor = null;
}
}


public class E03_StyleSheet : EditorWindow
{
public void OnEnable()
{
var root = this.GetRootVisualContainer();
root.AddStyleSheetPath("styles");
// Here we just take all layout properties and other to extract them in USS!
var boxes = new VisualContainer() { name = "boxesContainer" };
boxes.AddToClassList("horizontalContainer");
root.Add(boxes);
}
Unity5.3で知識が止まっている人向けのUnity2017.2に合わせたエディター拡張アップデート
Unity5.3で知識が止まっている人向けのUnity2017.2に合わせたエディター拡張アップデート
Unity5.3で知識が止まっている人向けのUnity2017.2に合わせたエディター拡張アップデート
Unity5.3で知識が止まっている人向けのUnity2017.2に合わせたエディター拡張アップデート

More Related Content

More from Keigo Ando

Unity5.3の機能まとめ
Unity5.3の機能まとめUnity5.3の機能まとめ
Unity5.3の機能まとめKeigo Ando
 
Unibook4執筆ガイドライン
Unibook4執筆ガイドラインUnibook4執筆ガイドライン
Unibook4執筆ガイドラインKeigo Ando
 
わたしのVisual studio環境
わたしのVisual studio環境わたしのVisual studio環境
わたしのVisual studio環境Keigo Ando
 
Unibook3執筆ガイドライン
Unibook3執筆ガイドラインUnibook3執筆ガイドライン
Unibook3執筆ガイドラインKeigo Ando
 
UNIBOOK2執筆ガイドライン
UNIBOOK2執筆ガイドラインUNIBOOK2執筆ガイドライン
UNIBOOK2執筆ガイドラインKeigo Ando
 
Unityでアプリを作るには
Unityでアプリを作るにはUnityでアプリを作るには
Unityでアプリを作るにはKeigo Ando
 
Unity2DとNewGUIについて
Unity2DとNewGUIについてUnity2DとNewGUIについて
Unity2DとNewGUIについてKeigo Ando
 
基本&ヒント
基本&ヒント基本&ヒント
基本&ヒントKeigo Ando
 
基本答え&解説のみ
基本答え&解説のみ基本答え&解説のみ
基本答え&解説のみKeigo Ando
 
Editor10-提出方法
Editor10-提出方法Editor10-提出方法
Editor10-提出方法Keigo Ando
 
Unity Networkとの違い
Unity Networkとの違いUnity Networkとの違い
Unity Networkとの違いKeigo Ando
 
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話Keigo Ando
 
Editor スクリプティング 入門
Editor スクリプティング 入門Editor スクリプティング 入門
Editor スクリプティング 入門Keigo Ando
 
エディタ拡張勉強会第0回
エディタ拡張勉強会第0回エディタ拡張勉強会第0回
エディタ拡張勉強会第0回Keigo Ando
 
Unity3.5と4.0の違い
Unity3.5と4.0の違いUnity3.5と4.0の違い
Unity3.5と4.0の違いKeigo Ando
 
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!Keigo Ando
 
Asset server(管理者編)
Asset server(管理者編)Asset server(管理者編)
Asset server(管理者編)Keigo Ando
 
Unity games uplaod
Unity games uplaodUnity games uplaod
Unity games uplaodKeigo Ando
 

More from Keigo Ando (19)

Unity5.3の機能まとめ
Unity5.3の機能まとめUnity5.3の機能まとめ
Unity5.3の機能まとめ
 
Unibook4執筆ガイドライン
Unibook4執筆ガイドラインUnibook4執筆ガイドライン
Unibook4執筆ガイドライン
 
わたしのVisual studio環境
わたしのVisual studio環境わたしのVisual studio環境
わたしのVisual studio環境
 
Unibook3執筆ガイドライン
Unibook3執筆ガイドラインUnibook3執筆ガイドライン
Unibook3執筆ガイドライン
 
UNIBOOK2執筆ガイドライン
UNIBOOK2執筆ガイドラインUNIBOOK2執筆ガイドライン
UNIBOOK2執筆ガイドライン
 
Unityでアプリを作るには
Unityでアプリを作るにはUnityでアプリを作るには
Unityでアプリを作るには
 
Unity2DとNewGUIについて
Unity2DとNewGUIについてUnity2DとNewGUIについて
Unity2DとNewGUIについて
 
基本&ヒント
基本&ヒント基本&ヒント
基本&ヒント
 
基本答え&解説のみ
基本答え&解説のみ基本答え&解説のみ
基本答え&解説のみ
 
応用のみ
応用のみ応用のみ
応用のみ
 
Editor10-提出方法
Editor10-提出方法Editor10-提出方法
Editor10-提出方法
 
Unity Networkとの違い
Unity Networkとの違いUnity Networkとの違い
Unity Networkとの違い
 
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話
CodeTemplateについて / SublimeText → Monodevelopに戻ってきた話
 
Editor スクリプティング 入門
Editor スクリプティング 入門Editor スクリプティング 入門
Editor スクリプティング 入門
 
エディタ拡張勉強会第0回
エディタ拡張勉強会第0回エディタ拡張勉強会第0回
エディタ拡張勉強会第0回
 
Unity3.5と4.0の違い
Unity3.5と4.0の違いUnity3.5と4.0の違い
Unity3.5と4.0の違い
 
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!
【第5回】渋谷Unity技術勉強会 - WebPlayer面白いよ!
 
Asset server(管理者編)
Asset server(管理者編)Asset server(管理者編)
Asset server(管理者編)
 
Unity games uplaod
Unity games uplaodUnity games uplaod
Unity games uplaod
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

Unity5.3で知識が止まっている人向けのUnity2017.2に合わせたエディター拡張アップデート

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. 
 
 
 
 
 
 public class Hierarchy : EditorWindow { public Dictionary<int, bool> foldouts = new Dictionary<int, bool>(); void OnGUI() { var id = 1; foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent"); if (foldouts[id]) { EditorGUI.indentLevel = 2; EditorGUILayout.LabelField("Child"); } } }
  • 9. 
 
 
 
 
 
 public class Hierarchy : EditorWindow { public Dictionary<int, bool> foldouts = new Dictionary<int, bool>(); void OnGUI() { var id = 1; foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent"); if (foldouts[id]) { EditorGUI.indentLevel = 2; EditorGUILayout.LabelField("Child"); } } }
  • 10. 
 
 
 
 
 
 public class Hierarchy : EditorWindow { public Dictionary<int, bool> foldouts = new Dictionary<int, bool>(); void OnGUI() { var id = 1; foldouts[id] = EditorGUILayout.Foldout(foldouts[id], "Parent"); if (foldouts[id]) { EditorGUI.indentLevel = 2; EditorGUILayout.LabelField("Child"); } } }
  • 11. 
 
 
 
 
 
 protected override TreeViewItem BuildRoot () { var root = new TreeViewItem {id = 0, depth = -1, displayName = "Root"}; var allItems = new List<TreeViewItem> { new TreeViewItem {id = 1, depth = 0, displayName = "Animals"}, new TreeViewItem {id = 2, depth = 1, displayName = "Mammals"}, new TreeViewItem {id = 3, depth = 2, displayName = "Tiger"}, new TreeViewItem {id = 7, depth = 1, displayName = "Reptiles"}, new TreeViewItem {id = 8, depth = 2, displayName = "Crocodile"}, new TreeViewItem {id = 9, depth = 2, displayName = "Lizard"}, }; return root; }
  • 13.
  • 14.
  • 15. 😂
  • 16.
  • 18.
  • 19. 
 
 
 
 [MenuItem(“ ")] static void Open() { // BuildPipeline.BuildPlayer(options); }
  • 20. 
 
 
 
 
 class MyCustomBuildProcessor : IPreprocessBuild { public void OnPreprocessBuild(BuildTarget target, string path) { Debug.Log(“ ”); } }
  • 21.
  • 22. [ScriptedImporter(1, "cube")] public class CubeImporter : ScriptedImporter { public float m_Scale = 1; public override void OnImportAsset(AssetImportContext ctx) { var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); var text = File.ReadAllText(ctx.assetPath); var position = JsonUtility.FromJson<Vector3>(text); cube.transform.position = position; } }
  • 24. 
 
 
 
 
 
 [CustomEditor(typeof(Object))] public class ObjectEditor : Editor { public ObjectEditor () { if (extension == ".zip") { editor = Editor.CreateEditor (Selection.activeObject, typeof(ZipEditor)); } else if (string.IsNullOrEmpty (extension)) { editor = Editor.CreateEditor (Selection.activeObject, typeof(FolderEditor)); } else { editor = null; } }
  • 25.
  • 26. public class E03_StyleSheet : EditorWindow { public void OnEnable() { var root = this.GetRootVisualContainer(); root.AddStyleSheetPath("styles"); // Here we just take all layout properties and other to extract them in USS! var boxes = new VisualContainer() { name = "boxesContainer" }; boxes.AddToClassList("horizontalContainer"); root.Add(boxes); }