void OnTriggerEnter2D(Collider2D col) { if (col.GetComponent <BMaze_MonsterMovement>()) { col.GetComponent <BMaze_MonsterMovement>().Pickup(pickup); } if (pickup == TypeOfPickup.Water) { GetComponent <BMaze_WaterPickup> ().IncreaseTime(); } BMaze_Manager.GetInstance().ShowSubtitle(pickup.ToString()); pickupMan.pickupList.Remove(gameObject); gameObject.SetActive(false); }
void Start() { rigBody = GetComponent <Rigidbody2D> (); allowMovement = true; manager = BMaze_Manager.GetInstance(); /* * if (!SnapGen) { * SnapGen = GameObject.Find ("SnapPointCreator").GetComponent<BMaze_SnapPointGenerator>(); * } */ audioSrc = GetComponent <AudioSource> (); //locationX = SnapGen.startingGridX; //locationY = SnapGen.startingGridY; //MoveToSnapPoint (); //CheckAllCollisions (); }
public void Display(string subtitle, AudioClip clip = null, bool queue = false) { if (!gameObject.activeSelf) { gameObject.SetActive(true); } if (sub == null) { sub = new Subtitle(); } if (!queue || !isDisplaying) { isDisplaying = true; sub.Display(gameObject, textComp, subtitle, clip); if (EmotionsGameManager.GetInstance()) { StartCoroutine(WaitTillHide(EmotionsGameManager.GetInstance().waitDuration)); } else if (BMaze_Manager.GetInstance()) { StartCoroutine(WaitTillHide(2f)); } /* * else if (MemoryMatchGameManager.GetInstance ()) { * StopCoroutine (WaitTillHide(3f)); * StartCoroutine (WaitTillHide (3f)); * } */ } else { Tuple <string, AudioClip> t = new Tuple <string, AudioClip>(subtitle, clip); displayQueue.Enqueue(t); t.ToString(); } }
void OnTriggerEnter2D(Collider2D col) { print("Finish"); if (finished) { col.GetComponentInChildren <BMaze_Monster> ().PlayDance(); col.GetComponent <BMaze_MonsterMovement> ().allowMovement = false; col.GetComponent <BMaze_MonsterMovement> ().finished = true; col.GetComponent <BMaze_MonsterMovement> ().gotoPos = finishSpot.transform.position; //col.transform.position = finishSpot.transform.position; audioSrc.Play(); if (!BMaze_Manager.isTutorialRunning) { StartCoroutine(BMaze_Manager.GetInstance().EndGameWait(3f)); } else { BMaze_Manager.GetInstance().TutorialFinished(); } } }