Esempio n. 1
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        player = GameObject.FindGameObjectWithTag(TagsManager.Player);

        agent         = gameObject.GetComponent <NavMeshAgent>();
        enemyAnimator = gameObject.GetComponent <Animator>();
        enemyRB       = gameObject.GetComponent <Rigidbody>();

        bossHealthAndDamage = gameObject.GetComponent <BossEnemyDamageAndDeathControls>();
        jumpOnTarget        = gameObject.GetComponent <JumpOnTarget>();

        isJumping = false;

        randomSelectedTimeStateChange = Random.Range(minTimeCountBetweenStateChange,
                                                     maxTimeCountBetweenStateChange);
        currentTimeStateChange = 0;

        timesFunctionCalled = 0;

        lowHeathAnimationCount = -1;
        disableUpdate          = false;

        UpdateState(EnemyState.Idle);
    }
Esempio n. 2
0
 /// <summary>
 /// Start is called on the frame when a script is enabled just before
 /// any of the Update methods is called the first time.
 /// </summary>
 void Start()
 {
     jumpOnTarget = gameObject.GetComponent <JumpOnTarget>();
 }