コード例 #1
0
 // Use this for initialization
 void Start()
 {
     target   = PlayerManager.instance.player.transform;
     enemyNav = GetComponent <EnemyNav>();
     agent    = GetComponent <NavMeshAgent>();
     anim     = GetComponent <Animator>();
 }
コード例 #2
0
 /*Get components for use in other methods*/
 void Start()
 {
     afc      = GetComponent <AlwaysFaceCamera>();
     an       = GetComponent <Animation>();
     en       = GetComponent <EnemyNav>();
     origin   = transform.position;
     origin.y = origin.y + 1;
 }
コード例 #3
0
 private void Awake()
 {
     AM       = FindObjectOfType <Audiomanager>();
     GM       = FindObjectOfType <GameManager>();
     anim     = GetComponent <Animator>();
     rb       = GetComponent <Rigidbody>();
     navAgent = GetComponent <NavMeshAgent>();
     capsCol  = GetComponent <CapsuleCollider>();
     boxCol   = GetComponent <BoxCollider>();
     enemyNav = GetComponent <EnemyNav>();
 }
コード例 #4
0
    private void Start()
    {
        anim = GetComponent <Animator>();

        eNav = transform.parent.GetComponent <EnemyNav>();
        if (eNav == null)
        {
            Debug.LogError("ACS17AnimationManager:Start() - Can't find EnemyNav component on self or parent.");
            return;
        }

        inited = true;
    }
コード例 #5
0
    void Start()
    {
        enemyNavController = Instantiate(navControllerPrefab, player.transform);
        enemyNav           = enemyNavController.GetComponent <EnemyNav>();
        enemyUnitData      = SetupUnitData(enemyUnitData);

        // TODO: temp fix for testing REMOVE THIS
        for (int a = 0; a < enemyUnitData.Length; a++)
        {
            for (int i = 0; i < enemyUnitData[a].activeInstances.transform.childCount; i++)
            {
                // TODO fix this but not really because we should just remove it anyway
                enemyUnitData[a].activeInstances.transform.GetChild(i).transform.position = new Vector3(UnityEngine.Random.Range(-10, 10), 0, UnityEngine.Random.Range(-10, 10));
                enemyUnitData[a].activeCount += 1;
            }
        }
    }
コード例 #6
0
    //------------------------------------
    //------------------------------------


    // Use this for initialization
    void Start()
    {
        _target         = PlayerManager.instance.player.transform;
        _agent          = GetComponent <NavMeshAgent>();
        _enemyNav       = GetComponent <EnemyNav>();
        _enemyHealth    = GetComponent <EnemyHealth> ();
        _animController = GetComponent <GoblinAnimationController>();
        _enemyGenerator = GameObject.Find("EnemyGenerator").GetComponent <EnemyGenerator> ();
        _fieldOfView    = GetComponent <FieldOfView> ();
        if (_target)            //視野表示のターゲットを_targetに変更
        {
            _fieldOfView.SetTarget(_target);
        }
        _state         = State.LOCOMOTION;
        _soundReaction = GetComponent <EnemySoundReaction> ();
        _lockOn        = false;
        _lockOnRadius  = _fieldOfView.GetLookRadius() / 2;
        _goblinList    = _enemyGenerator.GetGoblinList( );
        _findedBomb    = null;
    }
コード例 #7
0
ファイル: EnemyHealth.cs プロジェクト: Jinnaikun/Maze_Gunner
    WaitForSeconds enemyDeathTimer; //Timer for enemy's gameobject to be destroyed.

    void Awake()
    {
        //Fill references
        enemyNav   = FindObjectOfType <EnemyNav>();
        enemyColor = GetComponent <MeshRenderer>();
    }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     enemy = gameObject;
     enNav = GetComponent <EnemyNav>();
 }
コード例 #9
0
 // Start is called before the first frame update
 void Start()//pega script da AI do inimigo
 {
     enNav = GetComponentInParent <EnemyNav>();
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     enemy = GetComponent <EnemyNav>();
     // Register this to know when AlertMode is entered (or exited)
     AlertModeManager.alertModeStatusChangeDelegate += AlertModeStatusChange;
 }