예제 #1
0
        void Start()
        {
            enemy_patrol   = GetComponent <EnemyPatrol>();
            enemy_follow   = GetComponent <EnemyFollow>();
            enemy          = GetComponent <Enemy>();
            enemy.onDeath += OnDeath;

            if (vision_prefab)
            {
                GameObject vis = Instantiate(vision_prefab, GetEye(), Quaternion.identity);
                vis.transform.parent = transform;
                vision              = vis.GetComponent <EnemyVision>();
                vision.target       = this;
                vision.vision_angle = vision_angle;
                vision.vision_range = vision_range;
            }

            ChangeState(EnemyLOSState.Patrol);
        }