Ejemplo n.º 1
0
        /// <summary>
        /// Begin GUI
        /// </summary>
        private void GetBuilderGUI()
        {
            SetGUIColorScheme();

            GUILayout.Label(TITLE, EditorStyles.largeLabel);

            PegHelperText();

            DisplayBlockProperties();

            if (GUILayout.Button(startButtonText[i], GUILayout.MaxWidth(100f)))
            {
                i = 1;
                if (blockList != null)
                {
                    if (obj != null && pegCount > 0)
                    {
                        blockList.CreateBlock(
                            (GameObject)obj,
                            pegCount,
                            length,
                            width,
                            length,
                            material,
                            highlightMaterial);
                    }
                }
                else
                {
                    blockList = new BlockList();
                }
            }
            if (blockList != null)
            {
                if (blockList.AGameObjects != null)
                {
                    scale = EditorGUILayout.FloatField("Spawn Scale", scale);
                    if (GUILayout.Button("Build Block"))
                    {
                        BuildProto();
                    }
                    if (GUILayout.Button("Prefab It!"))
                    {
                        PrefabCreatedBlock();
                    }
                    DebugBuilder();
                }
            }
            GUILayout.Label("Debug", EditorStyles.miniBoldLabel);
            if (GUILayout.Toggle(debugger, GUIContent.none))
            {
                debugger = true;
            }
            else
            {
                debugger = false;
            }
        }
Ejemplo n.º 2
0
        void OnGUI()
        {
            GUILayout.Label("Block Builder", EditorStyles.boldLabel);

            pegCount = EditorGUILayout.IntField("Quantity of Pegs", pegCount);
            height   = EditorGUILayout.IntField("Height of Block", height);

            obj = EditorGUILayout.ObjectField(obj, typeof(GameObject), true);

            if (GUILayout.Button("Create Block"))
            {
                if (blockList != null)
                {
                    if (obj != null && pegCount > 0)
                    {
                        blockList.CreateBlock((GameObject)obj, pegCount, height);
                    }
                }
                else
                {
                    blockList = new BlockList();
                }
            }
            if (GUILayout.Button("Peg Count"))
            {
                if (blockList != null)
                {
                    blockList.PegCounter();
                }
            }
            if (GUILayout.Button("Clear Block List"))
            {
                if (blockList != null)
                {
                    blockList.ClearBlocks();
                    Debug.Log("All Blocks Cleared");
                }
            }
            GUILayout.Label("Debug", EditorStyles.miniBoldLabel);
            if (GUILayout.Toggle(debugger, GUIContent.none))
            {
                debugger = true;
            }
            else
            {
                debugger = false;
            }
            if (blockList != null && debugger)
            {
                GUILayout.Label("Quantity Of Blocks In List", EditorStyles.miniBoldLabel);
                GUILayout.TextArea(blockList.ListBlocks().Count.ToString(), EditorStyles.textArea);
            }
        }