public static void CloneWizard(PopulateRuleOverideTileWizard oldWizard) { PopulateRuleOverideTileWizard wizard = DisplayWizard <PopulateRuleOverideTileWizard>("Populate Override", "Populate"); wizard.m_tileset = oldWizard.m_tileset; wizard.m_spriteSet = oldWizard.m_spriteSet; }
public override void OnInspectorGUI() { serializedObject.UpdateIfRequiredOrScript(); EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Tile")); EditorGUILayout.PropertyField(serializedObject.FindProperty("m_OverrideSelf")); EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Advanced")); serializedObject.ApplyModifiedProperties(); using (new EditorGUI.DisabledScope(overrideTile.m_Tile == null)) { if (GUILayout.Button("Populate based on sprite sheet...")) { foreach (UnityEngine.Object obj in serializedObject.targetObjects) { PopulateRuleOverideTileWizard.CreateWizard(obj as RuleOverrideTile); } } } if (!overrideTile.m_Advanced) { using (new EditorGUI.DisabledScope(overrideTile.m_Tile == null)) { EditorGUI.BeginChangeCheck(); overrideTile.GetOverrides(m_Sprites); m_SpriteList.list = m_Sprites; m_SpriteList.DoLayoutList(); if (EditorGUI.EndChangeCheck()) { for (int i = 0; i < targets.Length; i++) { RuleOverrideTile tile = targets[i] as RuleOverrideTile; tile.ApplyOverrides(m_Sprites); } } } } else { using (new EditorGUI.DisabledScope(overrideTile.m_Tile == null)) { overrideTile.GetOverrides(m_Rules); m_RuleList.list = m_Rules; m_RuleList.DoLayoutList(); } } }
//[MenuItem("Assets/Generate Rule Tile Override")] public static void CreateWizard(RuleOverrideTile target) { PopulateRuleOverideTileWizard wizard = DisplayWizard <PopulateRuleOverideTileWizard>("Populate Override", "Populate"); wizard.m_tileset = target; }
static void MenuOption(MenuCommand menuCommand) { PopulateRuleOverideTileWizard.CreateWizard(menuCommand.context as RuleOverrideTile); }