void LoadSpellbook() { playerone.FillSpellbook(); playertwo.FillSpellbook(); battleUIManager.SetSpellbookUI(); }
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; }