Example #1
0
    // Use this for initialization
    void Start()
    {
        em = GetComponentInParent <EntityManager>();
        em.AddEntitySpawner(gameObject);
        int totalPlayers = GameObject.Find("Persistant").GetComponent <TitleScreen> ().numPlayers;
        int playerNum    = entity.GetComponent <PlayerController> ().playerNumber;

        print("Spawning " + playerNum + " out of " + totalPlayers);
        if (playerNum <= totalPlayers)
        {
            print("Success " + playerNum);
            if (spawnAtStart)
            {
                SpawnEntity();
            }
        }
    }