Ejemplo n.º 1
0
    void Start()
    {
        infotext.text = "Загрузка...";
        photonView    = PhotonView.Get(this);
        playerobjects = GameObject.FindGameObjectsWithTag("Player");
        if (playerobjects[0].GetComponent <Player>().photonView.ViewID < playerobjects[1].GetComponent <Player>().photonView.ViewID)
        {
            playerone = playerobjects[0].GetComponent <Player>();
            playertwo = playerobjects[1].GetComponent <Player>();
        }
        else
        {
            playerone = playerobjects[1].GetComponent <Player>();
            playertwo = playerobjects[0].GetComponent <Player>();
        }

        if (playerone.photonView.IsMine)
        {
            localplayer = playerone;
            Debug.Log("local player one");
        }
        else if (playertwo.photonView.IsMine)
        {
            localplayer = playertwo;
            Debug.Log("local player two");
        }

        players[0] = playerone; players[1] = playertwo;

        battleManager.SetPlayer(playerone, playertwo);
        battleUIManager.SetPlayer(playerone, playertwo);
        battleUIManager.SetNames();

        localplayer.FillSpellbookNumbers();



        //if (Random.value > 0.5)
        //{

        playerone.hasturn = true;
        playerone.IncreaseMana();
        // }
        // else
        // {
        //   playertwo.hasturn = true;
        //   playertwo.IncreaseMana();
        //}
        battleManager.attacker = playerone;
        battleManager.defender = playertwo;
        battleUIManager.UpdateStats();
    }
Ejemplo n.º 2
0
    void Start()
    {
        photonView    = PhotonView.Get(this);
        playerobjects = GameObject.FindGameObjectsWithTag("Player");
        if (playerobjects[0].GetComponent <Player>().photonView.viewID < playerobjects[1].GetComponent <Player>().photonView.viewID)
        {
            playerone = playerobjects[0].GetComponent <Player>();
            playertwo = playerobjects[1].GetComponent <Player>();
        }
        else
        {
            playerone = playerobjects[1].GetComponent <Player>();
            playertwo = playerobjects[0].GetComponent <Player>();
        }

        if (playerone.photonView.isMine)
        {
            localplayer = playerone;
            Debug.Log("local player one");
        }
        else if (playertwo.photonView.isMine)
        {
            localplayer = playertwo;
            Debug.Log("local player two");
        }

        players[0] = playerone; players[1] = playertwo;

        battleManager.SetPlayer(playerone, playertwo);
        battleUIManager.SetPlayer(playerone, playertwo);
        battleUIManager.SetNames();

        battleUIManager.UpdateStats();
        battleUIManager.SetSpellbookUI();


        playerone.hasturn      = true;
        battleManager.attacker = playerone;
        battleManager.defender = playertwo;
    }