void DollChange() { if (GameManager.Instance.isClick && Click.ReturnTag() == "RedDevilDoll") { GetSound.instance.playSound(); int ran = Random.Range(0, 6); //Random.Range(0, 6); if (ran == 1) //붉은악마는 1번 { Devil1.gameObject.SetActive(false); Devil2.gameObject.SetActive(false); Devil3.gameObject.SetActive(false); Devil4.gameObject.SetActive(false); RedDevil.gameObject.SetActive(true); WC = true; } else if (ran == 2) { Devil1.gameObject.SetActive(true); Devil2.gameObject.SetActive(false); Devil3.gameObject.SetActive(false); Devil4.gameObject.SetActive(false); RedDevil.gameObject.SetActive(false); WC = false; } else if (ran == 3) { Devil1.gameObject.SetActive(false); Devil2.gameObject.SetActive(true); Devil3.gameObject.SetActive(false); Devil4.gameObject.SetActive(false); RedDevil.gameObject.SetActive(false); WC = false; } else if (ran == 4) { Devil1.gameObject.SetActive(false); Devil2.gameObject.SetActive(false); Devil3.gameObject.SetActive(true); Devil4.gameObject.SetActive(false); RedDevil.gameObject.SetActive(false); WC = false; } else if (ran == 5) { Devil1.gameObject.SetActive(false); Devil2.gameObject.SetActive(false); Devil3.gameObject.SetActive(false); Devil4.gameObject.SetActive(true); RedDevil.gameObject.SetActive(false); WC = false; } } }
void Update() { if (GameManager.Instance.isClick && Click.ReturnTag() == "MonocleObj" && GameManager.Instance.isMonocle) //+ 모노클 착용상태면 { missionImg(); StartMissionImg(); missionstartsound(); text.text = "Find Memory"; } if (GameManager.Instance.clear) //클리어면 { missionImg(); //배경, 버튼 뜨고 EndMissionImg(); //엔드 이미지 텍스트 뜨고 text.text = "Go to Next"; // 버튼 텍스트 변경하고 } }
void Update() { Debug.Log(getobj); if (!GameManager.Instance.startMission) //미션 상태가 아닐 때 위치 초기화 { for (int i = 0; i < gull_boy_obj_pos.Length; i++) { getobj = false; gull_boy_obj[i].transform.position = gull_boy_obj_pos[i]; } obj_Count = 5; } if (GameManager.Instance.isMonocle) { redImg[0].SetActive(false); redImg[1].SetActive(false); if (GameManager.Instance.missionCount == 2) { boxcol.enabled = true; monocleObj.SetActive(true); } } else { monocleObj.SetActive(false); } if (GameManager.Instance.missionCount == 2 && GameManager.Instance.startMission) //2일 때 모두 온 { Gull_init(true); //미션 시작 시 트루됨 if (GameManager.Instance.isClick && Click.ReturnTag() == "Gull_Obj") { GetSound.instance.playSound(); getobj = true; Debug.Log("Tag gull obj"); if (Click.ReturnName() == "굴렁쇠") { obj_Count = 0; } else if (Click.ReturnName() == "야구공") { obj_Count = 1; } else if (Click.ReturnName() == "clock") { obj_Count = 2; } else if (Click.ReturnName() == "줄넘기") { obj_Count = 3; } else if (Click.ReturnName() == "화분") { obj_Count = 4; } } else { getobj = true; } } if (getobj) { if (Vector3.Distance(gull_boy_obj[obj_Count].transform.position, monocleObj.transform.position) >= 2.0f) { GobackPos();//자리 초기화 gull_boy_obj[obj_Count].transform.position = Vector3.Lerp(gull_boy_obj[obj_Count].transform.position, parentObj.transform.position, 0.2f); } else { gull_boy_obj[obj_Count].transform.position = Vector3.Lerp(gull_boy_obj[obj_Count].transform.position, monocleObj.transform.position, 0.05f); } } Gull_Clear(); }