// Start is called before the first frame update void Start() { musicPlayer = GetComponent <AudioSource>(); lcon = GameObject.Find("Player").transform.Find("LightContainer").GetComponent <LightContainerController>(); lerpTime = lcon.arrangeTime; curPitch = minPitch; totalNumLights = GameObject.Find("Lights").transform.childCount; }
private void Update() { if (Player == null) { Player = GameObject.Find("Player"); } if (finishPortal == null) { finishPortal = GameObject.Find("Finish Portal"); } if (lights == null) { lights = GameObject.Find("Lights"); } if (lcon == null) { if (Player != null) { lcon = Player.transform.Find("LightContainer").GetComponent <LightContainerController>(); } } if (!curLevelIsFinished) { timer += Time.deltaTime; } if (Player != null) { int numLightsCollected = lcon.GetLightCount(); if (finishPortal != null) { if (AllLightsCollected(numLightsCollected)) { finishPortal.SetActive(true); finishPortal.transform.GetChild(0).gameObject.SetActive(true); } else { finishPortal.SetActive(false); } } } TimeText.text = (Mathf.Round(timer * 100f) / 100f).ToString() + " s"; //Debug.Log("Light Movement Factor ------------> " + lcon.GetLightMovementFactor()); }
// Use this for initialization void Start() { ani = GetComponent <Animator>(); rb2d = GetComponent <Rigidbody2D>(); lcon = transform.Find("LightContainer").GetComponent <LightContainerController>(); }
// Use this for initialization void Start() { lcon = transform.Find("LightContainer").GetComponent <LightContainerController>(); }