Example #1
0
    void Start()
    {
        itsef = gameObject.GetComponent <EnemyTest>();

        currentLife = maxLife;

        agent = GetComponent <NavMeshAgent>();

        player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();

        gm = GameObject.FindGameObjectWithTag("Managers").GetComponent <GameManager>();

        audPlay = GetComponentInChildren <AudioPlayer>();

        stealth = player.GetComponentInChildren <StealthSystem>();

        playerDetector = GetComponentInChildren <EnemyPlayerDetector>();

        sight = GetComponentInChildren <EnemySight>();

        attack = GetComponentInChildren <EnemyAttackArea>();

        execution = GetComponentInChildren <ExecutionArea>();

        rigid = GetComponent <Rigidbody>();

        anim = GetComponent <EnemyAnimations>();

        anim.Initialize();

        playerDetector.Initialize();

        sight.Initialize();

        execution.Initialize();

        states = State.Stationary;

        StationarySet();

        generalWaitOnPointTime = initGeneralWaitOnPointTime;
        waitOnPointTime        = initWaitOnPointTime;
        waitComeFromSound      = initWaitComeFromSound;
        percentageOfWait       = initPercentageOfWait;
    }