public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        VillagerSpawner spawner = target as VillagerSpawner;

        if (GUILayout.Button("Add Spawn Point"))
        {
            spawner.CreateSpawnPoint();
        }

        if (GUILayout.Button("Force Spawn"))
        {
            spawner.SpawnVillager();
        }
    }
示例#2
0
    private void Awake()
    {
        if (vs == null)
        {
            vs = this;
        }
        else
        {
            Destroy(gameObject);
        }

        for (int i = 0; i < spawnPoints.Count; i++)
        {
            SpawnVillager(i);
        }
    }
示例#3
0
 private void Start()
 {
     villagerSpawner = VillagerSpawner.vs;
 }