void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode)
    {
        Debug.Log("Level Loaded");
        Debug.Log(scene.name);
        Debug.Log(mode);
        Complete.GameManager gm = null;
        var gobjs = scene.GetRootGameObjects();

        foreach (var gobj in gobjs)
        {
            if (gobj.name == "GameManager")
            {
                gm = gobj.GetComponent <Complete.GameManager>();
            }
        }
        GameObject[] spawnPoints = GameObject.FindGameObjectsWithTag("Respawn");
        if (gm != null)
        {
            gm.m_Tanks = new Complete.TankManager[m_players.Count];
            int playerCount = 0;
            foreach (PlayerParam player in m_players)
            {
                gm.m_Tanks[playerCount] = new Complete.TankManager();
                gm.m_Tanks[playerCount].m_PlayerColor  = player.m_color;
                gm.m_Tanks[playerCount].m_PlayerNumber = player.m_ID;
                gm.m_Tanks[playerCount].m_SpawnPoint   = spawnPoints[playerCount].transform;
                playerCount++;
            }
        }
    }
Exemple #2
0
    public void Awake()
    {
        gm                  = Complete.GameManager.gm;
        Actions             = new Queue <Action>();
        State_Score         = 0;
        AI_Table_Score      = 0;
        Player_Table_Score  = 0;
        AI_Hand_Score       = 0;
        Player_Health_Score = 0;
        AI_Health_Score     = 0;

        Attackweight     = 1;
        Healthweight     = 1;
        Manaweight       = 0.1f;
        HeroHealthweight = 0.1f;
    }
Exemple #3
0
    // Start is called before the first frame update
    void Start()
    {
        gm             = Complete.GameManager.gm;
        playerDeck     = gm.MyDeckCards;
        oppDeck        = gm.AIDeckCards;
        playerHandSize = 0;
        oppHandSize    = 0;
        currentCard    = 0;
        oppCurrentCard = 0;

        //Initial Draw
        for (int i = 0; i < 3; i++)
        {
            Draw();
            CreateOppCard();
        }
    }
Exemple #4
0
 private PlayerManager()
 {
     gameManager = Complete.GameManager.Instance;
 }
 private void Start()
 {
     gm         = Complete.GameManager.gm;
     Canvas     = GameObject.Find("Main Canvas");
     playerZone = gm.playerTable;
 }