IEnumerator StartupAnimation() { for (int i = 0; i < NUM_CUBES; i++) { HexaCube cube = transform.FindChild("startupAnimation/" + i.ToString()).GetComponent <HexaCube>(); cube.Spawn(Constants.BLACK); cube.transform.FindChild("LookRotation").localScale = Vector3.one * 1.3f; } yield return(new WaitForSeconds(0.5f)); transform.FindChild("progressBar").gameObject.SetActive(true); transform.FindChild("progressBarBG").gameObject.SetActive(true); for (int i = NUM_CUBES - 1; i >= 0; i--) { HexaCube cube = transform.FindChild("startupAnimation/" + i.ToString()).GetComponent <HexaCube>(); cube.Despawn(); cube.Spawn(Constants.WHITE); yield return(new WaitForSeconds(0.02f)); } yield return(new WaitForSeconds(0.5f)); transform.FindChild("progressBarBG").gameObject.SetActive(false); transform.FindChild("startupAnimation").gameObject.SetActive(false); for (int i = 0; i < NUM_CUBES; i++) { progressCubes[i].gameObject.SetActive(true); } }
public void Awake() { playerActions = GameObject.Find("PlayerActions").GetComponent <PlayerActions>(); hexaCube = (Object.Instantiate(HexaCubePrefab) as GameObject).GetComponent <HexaCube>(); hexaCube.transform.parent = transform; hexaCube.transform.localPosition = Vector3.zero; hexaCube.gridPlace = this; displayTransform = hexaCube.transform.FindChild("LookRotation"); targetScale = Vector3.one; }
public void Awake() { playerActions = GameObject.Find("PlayerActions").GetComponent<PlayerActions>(); hexaCube = (Object.Instantiate(HexaCubePrefab) as GameObject).GetComponent<HexaCube>(); hexaCube.transform.parent = transform; hexaCube.transform.localPosition = Vector3.zero; hexaCube.gridPlace = this; displayTransform = hexaCube.transform.FindChild("LookRotation"); targetScale = Vector3.one; }
void Awake() { hex1 = transform.FindChild("rotator/HexaCube1").GetComponent <HexaCube>(); hex2 = transform.FindChild("rotator/HexaCube2").GetComponent <HexaCube>(); anim = transform.FindChild("rotator").GetComponent <Animation>(); }
void Awake() { hex1 = transform.FindChild("rotator/HexaCube1").GetComponent<HexaCube>(); hex2 = transform.FindChild("rotator/HexaCube2").GetComponent<HexaCube>(); anim = transform.FindChild("rotator").GetComponent<Animation>(); }