private IEnumerator UsePopUp() { Debug.Log("PopUpController UsePopUp()"); popUp = (PopUp)transform.parent.GetComponent(popUpType); yield return(new WaitForSeconds(popUpDelay)); popUp.Activate(); }
private void Hide_PopUp(Collision col) { hide = col.collider.GetComponent <Hide_Data>(); Vector3 pos = hide.HidePoint; Vector3 length = (pos - transform.position).normalized; if (hide.Cheak(length) && !GetHIDE_NOW()) { pop = GetComponent <PopUp>(); pop.SetText(" B:隠れる");//仮 pop.Activate(120); } hide = null; }
// public int KeyData; private void DoorPopup(string name) { // for (int i = 0; i < KeyData.Length; i++) { if (KeyData[i] && (name == "door" + i)) { pop = GetComponent <PopUp>(); pop.SetText(" B:扉を開ける "); pop.Activate(120); return; } } pop = GetComponent <PopUp>(); pop.SetText(" 鍵がかかっているようだ・・・ ");//仮 pop.Activate(180); return; }
void OnCollisionEnter(Collision col) { Contact_Collision = true; param.movement = Vector3.zero; //敵との接触判定 ==死亡判定 if (col.gameObject.tag == "Hide_Object") { Hide_PopUp(col); } //敵との接触判定 ==死亡判定 if (col.gameObject.tag == "Enemy") { Deth_Prosess(); return; } //ゲームクリア判定 else if (col.gameObject.tag == "CLEAR") { Clear_prosess(); return; ; } //シーン移動判定 else if (col.gameObject.tag == "ChengeScene") { ChengeScene_Proasess(col.gameObject.name.ToString()); return; } //かぎに接触 if (col.gameObject.tag == "KEY") { this.CheakKey(col.gameObject.name.ToString()); pop = GetComponent <PopUp>(); if (col.gameObject.name == "Last_Key") { pop.SetText(" 玄関の鍵を手に入れた!! ");//仮 LAST_KEY = true; } else { pop.SetText(" かぎを取得 ");//仮 } pop.Activate(60); } if (col.gameObject.tag == "DOOR") { hoge = col.gameObject.name.ToString(); DoorPopup(col.gameObject.name.ToString()); } if (col.gameObject.tag == "FrontDoor") { if (LAST_KEY) { door = col.collider.GetComponent <Door>(); door.Open_Door(); Clear_prosess(); return; } hoge = col.gameObject.name.ToString(); DoorPopup(col.gameObject.name.ToString()); } }