public override void OnInspectorGUI()
        {
            RandomPlacement placer = (RandomPlacement)target;

            if (GUILayout.Button("Repeat Trees placement"))
            {
                placer.RepeatTreesPlacement();
            }
            if (GUILayout.Button("Repeat Mushrooms placement"))
            {
                placer.RepeatMushroomsPlacement();
            }
            if (GUILayout.Button("Repeat all placement"))
            {
                placer.RepeatAllPlacement();
            }

            GUILayout.Space(10);
            if (GUILayout.Button("Remove Trees"))
            {
                placer.Clear(placer.instantiatedTrees);
            }
            if (GUILayout.Button("Remove Mushrooms"))
            {
                placer.Clear(placer.instantiatedMushrooms);
            }
            DrawDefaultInspector();
        }
예제 #2
0
    // Use this for initialization
    void Awake()
    {
        instance = this;

        map = GameObject.Find("Map - Flat").GetComponent <GOMap> ();


        if (map == null)
        {
            Debug.LogWarning("GOObject - Map property not set");
            return;
        }
    }
예제 #3
0
    IEnumerator ReSpawn(GameObject g, float delay)
    {
        yield return(new WaitForSeconds(delay));

        RandomPlacement m_random = g.GetComponent <RandomPlacement> () as RandomPlacement;

        if (m_random && !m_random.enabled)
        {
            m_random.enabled = true;
        }

        g.SetActive(true);
    }