// Start is called before the first frame update void Start() { //Black rolls one die first myTurn = isBlack; //Set jailControl and baseControl variable based on color if (isBlack) { jailControl = gameMaster.blackJailControl; baseControl = gameMaster.blackBaseControl; } else { jailControl = gameMaster.whiteJailControl; baseControl = gameMaster.whiteBaseControl; } meshRend = GetComponentInChildren <MeshRenderer>(); meshRend.enabled = false; //Declare length of 4 for doubles rollsUsed = new bool[4]; //Set audio objects audioSource = gameMaster.GetComponent <AudioSource>(); }
void SetBaseSpots() { whiteBaseControl = GameObject.Find("BaseWhite").GetComponent <PieceContainerObject>(); blackBaseControl = GameObject.Find("BaseBlack").GetComponent <PieceContainerObject>(); whiteBaseControl.enabled = true; blackBaseControl.enabled = true; }
void SetJailSpots() { whiteJailControl = GameObject.Find("JailWhite").GetComponent <PieceContainerObject>(); blackJailControl = GameObject.Find("JailBlack").GetComponent <PieceContainerObject>(); whiteJailControl.enabled = true; blackJailControl.enabled = true; }
void GetAllSpots() { allSpots = new PieceContainerObject[24]; for (int x = 1; x <= 4; x++) { for (int z = 1; z <= 6; z++) { PieceContainerObject pobj = GameObject.Find("Spot" + x + "." + z).GetComponent <PieceContainerObject>(); allSpots[((x - 1) * 6 + z) - 1] = pobj; pobj.enabled = true; } } }
public static PieceContainerControl GetPieceContainer(PieceContainerObject pObj) { switch (pObj.pcType) { case "Spot": return(new SpotControl((SpotControl)pObj.pcc)); case "Base": return(new BaseControl(pObj.pcc)); case "Jail": return(new JailControl(pObj.pcc)); default: return(null); } }