Page 411 - MDP2022-3
P. 411

(4)  조명






































            조명이  켜질  때  효과음을  내주는  컴포넌트



            using  System.Collections;
            using  System.Collections.Generic;
            using  UnityEngine;
            using  UnityEngine.AI;

            public  class  Key1Action  :  MonoBehaviour
            {
                    public  GameObject  key1Light;
                    public  GameObject  Key1Enemi;


                    public  bool  is_tricked  =  true;


                    public  void  CatchKey()
                    {
                            if  (is_tricked)
                            {
                                    is_tricked  =  false;
                                    key1Light.SetActive(true);
                                    key1Light.GetComponent<AudioSource>().Play();
                                    Key1Enemi.GetComponent<Animator>().SetBool("CatchKey",  true);
                                    HeadLotate.instance.StartCoroutine("FollowTarget");
                            }
                    }
            }
   406   407   408   409   410   411   412   413   414   415   416