private void putItemBackInPool(GameObject go) { List <GameObject> objects = obstaclePool [go.name]; go.transform.localScale = startScale; EnableDisableScript script = go.GetComponent <EnableDisableScript> (); if (script != null) { script.enableObstacle(); } go.SetActive(false); obstaclesInUse.Remove(go); objects.Add(go); }
private void disableLane(int laneLocked) { for (int x = 0; x < obstaclesInUse.Count; x++) { GameObject go = obstaclesInUse [x]; if (x % level.numberOfLanes == laneLocked) { EnableDisableScript script = go.GetComponent <EnableDisableScript> (); if (script != null) { script.disableObstacle(); } } } }
public void incrementStatus() { lockStatus++; dialogue.SetDialogState("stage" + lockStatus); //Get rid of the glow around the door when the final puzzle is solved. if (lockStatus == 3) { GameObject DoorGlow = GameObject.Find("BossDoorGlow"); EnableDisableScript eds = (EnableDisableScript)DoorGlow.GetComponent("EnableDisableScript"); if (eds != null) { eds.Disable(); } } }
// Use this for initialization void Start() { rend = GetComponent <Renderer>(); co2d = GetComponent <BoxCollider2D>(); colidRef = GetComponent <ColliderReference> (); GameObject glowObj = GameObject.Find(this.name + "Glow"); if (glowObj != null) { glowScript = (EnableDisableScript)glowObj.GetComponent("EnableDisableScript"); } if (disabled) { Disable(); } else { Enable(); } }