void Update() { if (Input.GetKeyDown(KeyCode.Q)) { talk.endTalk(); } if (count == 0) { talkSet(); } count++; }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "TalkTrigger") { talk.endTalk(); talk.playTalk(col.GetComponent <TalkTriggerNumAndMode>().talkNum, col.GetComponent <TalkTriggerNumAndMode>().talkMode); if (col.GetComponent <TalkTriggerNumAndMode>().willDestroyAfterPlay) { Destroy(col.gameObject); } } Debug.Log(col.gameObject.name); }
void OnTriggerStay(Collider col) { switch (stage) { case 1: if (col.gameObject.CompareTag("Player") && Input.GetAxis("Attack") == 1 && gm.stateCount == doorCount) { if (doorCount == 1) { gm.hintNum = 2; } if (enter == false) { switch (doorCount) { case 1: gm.hintNum = 2; break; case 3: talk.endTalk(); talk.playTalk(400, 0); enter = true; gm.hintNum = 5; break; } } if (fm.talkMode != 0) { gm.doorImgCount = doorCount; Instantiate(Resources.Load("CounterMagic1"), new Vector3(this.transform.position.x, this.transform.position.y, this.transform.position.z), Quaternion.identity); Destroy(gameObject); } } break; } }