Project/Alice Project 4

Window Mission

바람 오브젝트 선택 public class Select_wind : MonoBehaviour { [Header("Wind Object(Add Collider)")] public GameObject[] winds; // 바람 영역이 저장된 변수 public GameObject[] winds_warnning; // 위험 지역 표식이 저장된 변수 // Start is called before the first frame update void OnEnable() { StartCoroutine(selecte()); } void OnDisable() { foreach (GameObject o in winds) o.SetActive(false); // 모든 바람 비활성화 } // 바람 선택 IEnumerator se..

Cat Hunting

private void OnTriggerEnter(Collider other) { if (other.tag == "Cat_Attack_small") { Destroy(other.gameObject); count.damage_count++; } } 고양이가 공격을 당한 경우 공격 횟수가 증가한다. ( 공격 오브젝트 Tag == "Cat_Attack_small") IEnumerator attack_ready() { if (damage_count < 3) // 일반 공격 { angry_cat_face.SetActive(false); angry_cat_arm.SetActive(false); mordern_cat_face.SetActive(true); mordern_cat_arm.SetActive(true); A..

Inventory make

인벤토리 키고 끄기 Flow void Update() { check_input(); } void check_input() { if (Button.AButton) { if (inventory.activeSelf == false) inventory.SetActive(true); else inventory.SetActive(false); }​ 1. Update 메서드를 활용하여 Controller의 입력값의 변화를 감지하여 실행 2. Inventory의 현재 상태를 확인하여 활성화, 비활성화 아이템 넣기 Flow public InventoryObject inventory; public void OnTriggerEnter(Collider other) { var item = other.GetComponent();..