示例#1
0
        protected override void Start()
        {
            base.Start();

            playerMask = LayerMask.GetMask("Player");

            anim         = GetComponentInChildren <Animator>();
            coll         = GetComponent <Collider>();
            followTarget = GetComponent <FollowTarget>();
            lookAt       = GetComponent <LookAt>();
            sfx          = GetComponentInChildren <EnemySoundEffects>();

            GameObject player = GameObject.FindGameObjectWithTag("Player");

            if (player != null)
            {
                followTarget.target = player.transform;
                lookAt.target       = player.transform;
            }
        }