끼리끼리코끼리_2022100236_팀 프로젝트 개발일지 6.22


김민형 작업 분량

-사진 아이템 연계, 진행 요소 해제 트리거 스크립트

public class SecendPhotoTrigger : MonoBehaviour 
{     
    [Header("N번째 사진")]     
    public GameObject SecendPhoto;     
    [Header("다음 순서의 사진n일지")]     
    public GameObject NextPhoto;     
    public GameObject NextDiary;     
    public GameObject NextTrigger;           
    
    void Update()     
    {         
        if(SecendPhoto.gameObject.activeSelf == false)         
        {                          
            NextPhoto.SetActive(true);             
            NextDiary.SetActive(true);             
            NextTrigger.SetActive(true);             
            this.gameObject.SetActive(false);         
        }     
    } 
public class MainDoorTrigger : MonoBehaviour 
{     
    [Tooltip("1번째 사진")]     
    public GameObject FirstPhoto;     
    [Tooltip("정문")]     
    public GameObject MainDoor1;     
    private Exit mainDoor1;    
    public GameObject MainDoor2;     
    private Exit mainDoor2;      
    
    void Awake()     
    {         
        mainDoor1 = MainDoor1.GetComponent<exit>();        
        mainDoor2 = MainDoor2.GetComponent<exit>();     
    }     
    
    void Update()     
    {         
        if(FirstPhoto.gameObject.activeSelf == false)         
        {             
            Debug.Log("정문이 열렸다.");             
            mainDoor1.isLocked = false;             
            mainDoor2.isLocked = false;             
            this.gameObject.SetActive(false);         
        }     
    }     
}
public class MainDoorTrigger : MonoBehaviour 
{     
    [Tooltip("1번째 사진")]     
    public GameObject FirstPhoto;     
    [Tooltip("정문")]     
    public GameObject MainDoor1;     
    private Exit mainDoor1;     
    public GameObject MainDoor2;     
    private Exit mainDoor2;      
    void Awake()     
    {         
        mainDoor1 = MainDoor1.GetComponent<exit>();         
        mainDoor2 = MainDoor2.GetComponent<exit>();     
    }      
    void Update()     
    {         
        if(FirstPhoto.gameObject.activeSelf == false)         
        {             
            Debug.Log("정문이 열렸다.");             
            mainDoor1.isLocked = false;             
            mainDoor2.isLocked = false;             
            this.gameObject.SetActive(false);         
        }     
    } 
}
public class YouShallNotPass : MonoBehaviour 
{     
    public GameObject KeiKai;      
    
    void OnTriggerEnter(Collider o)     
    {         
        if(o.gameObject.CompareTag("Player"))         
        {             
            StartCoroutine(SomethingToDo());         
        }     
    }      
    IEnumerator SomethingToDo()     
    {         
        KeiKai.SetActive(true);         
        yield return new WaitForSecondsRealtime(2f);        //WaitSomethingToDo          
        KeiKai.SetActive(false);          
        yield return null;     
    } 
}

Files

Build622.zip 232 MB
Jun 22, 2023

Get 팀_끼리끼리코끼리_2022100236_6.22

Leave a comment

Log in with itch.io to leave a comment.