// Use this for initialization void Start() { //default values for Player 1 UI p1UI = gameObject.AddComponent <playerOneUI>(); p1UI.playerState = GameObject.Find("playerOneState").GetComponent <Text>(); p1UI.playerHealth = GameObject.Find("playerOneHealth").GetComponent <Text>(); p1UI.currentResource = GameObject.Find("playerOneResource").GetComponent <Text>(); //p1UI.playerState.text = "Placing"; p1UI.p1ResourceBackground = GameObject.Find("p1ResourceBackground").GetComponent <Image>(); p1UI.p1BlockBackground = GameObject.Find("p1BlockBackground").GetComponent <Image>(); p1UI.p1ReflectBackground = GameObject.Find("p1ReflectBackground").GetComponent <Image>(); p1UI.p1RefractBackground = GameObject.Find("p1RefractBackground").GetComponent <Image>(); p1UI.p1RedirectBackground = GameObject.Find("p1RedirectBackground").GetComponent <Image>(); //default values for Player 2 UI p2UI = gameObject.AddComponent <playerTwoUI>(); p2UI.playerState = GameObject.Find("playerTwoState").GetComponent <Text>(); p2UI.playerHealth = GameObject.Find("playerTwoHealth").GetComponent <Text>(); p2UI.currentResource = GameObject.Find("playerTwoResource").GetComponent <Text>(); //p2UI.playerState.text = "Placing"; p2UI.p2ResourceBackground = GameObject.Find("p2ResourceBackground").GetComponent <Image>(); p2UI.p2BlockBackground = GameObject.Find("p2BlockBackground").GetComponent <Image>(); p2UI.p2ReflectBackground = GameObject.Find("p2ReflectBackground").GetComponent <Image>(); p2UI.p2RefractBackground = GameObject.Find("p2RefractBackground").GetComponent <Image>(); p2UI.p2RedirectBackground = GameObject.Find("p2RedirectBackground").GetComponent <Image>(); }
// Use this for initialization void Start() { //default values for Player 1 UI p1UI = gameObject.AddComponent <playerOneUI>(); p1UI.playerState = GameObject.Find("playerOneState").GetComponent <Text>(); p1UI.playerHealth = GameObject.Find("playerOneHealth").GetComponent <Text>(); p1UI.currentResource = GameObject.Find("playerOneResource").GetComponent <Text>(); p1UI.playerState.text = "Placing"; p1UI.p1ResourceBackground = GameObject.Find("p1ResourceBackground").GetComponent <Image>(); p1UI.p1BlockBackground = GameObject.Find("p1BlockBackground").GetComponent <Image>(); p1UI.p1ReflectBackground = GameObject.Find("p1ReflectBackground").GetComponent <Image>(); p1UI.p1RefractBackground = GameObject.Find("p1RefractBackground").GetComponent <Image>(); p1UI.p1RedirectBackground = GameObject.Find("p1RedirectBackground").GetComponent <Image>(); //default values for Player 2 UI p2UI = gameObject.AddComponent <playerTwoUI>(); p2UI.playerState = GameObject.Find("playerTwoState").GetComponent <Text>(); p2UI.playerHealth = GameObject.Find("playerTwoHealth").GetComponent <Text>(); p2UI.currentResource = GameObject.Find("playerTwoResource").GetComponent <Text>(); p2UI.playerState.text = "Placing"; p2UI.p2ResourceBackground = GameObject.Find("p2ResourceBackground").GetComponent <Image>(); p2UI.p2BlockBackground = GameObject.Find("p2BlockBackground").GetComponent <Image>(); p2UI.p2ReflectBackground = GameObject.Find("p2ReflectBackground").GetComponent <Image>(); p2UI.p2RefractBackground = GameObject.Find("p2RefractBackground").GetComponent <Image>(); p2UI.p2RedirectBackground = GameObject.Find("p2RedirectBackground").GetComponent <Image>(); //Setup to set bases pOneCanBase = true; pTwoCanBase = true; pOneCanLaser = false; pTwoCanLaser = false; basePhase = true; laserPhase = false; noP1Direction = true; noP2Direction = true; haveSelected1 = false; haveSelected2 = false; selection1 = Building.Empty; selection2 = Building.Empty; i1 = 0; i2 = 0; }