Esempio n. 1
0
    public void AwakeEvent(Vector3 playerPosition)
    {
        RandomizeData();
        _transform                 = transform;
        _transform.position        = playerPosition - new Vector3(0, 0, helicopterData.zSpawnOffset);
        condition                  = GetComponent <EntityCondition>();
        condition.OnZeroCondition += ReturnObjectsToPool;
        helicopterData.PermanentSetUpHelicopter(this);

        InjectNewTargetData(PlayerHandler.PlayerInstance.truck._rigidbody);

        condition.ResetCondition(EnemyHandler.EnemyConditionCalculatedFromPlayerLevelAndComplexity());
    }
Esempio n. 2
0
    public void AwakeEnemy()
    {
        truck = GetComponent <Truck>();

        followTypeStateController = new StateMachine <Enemy>(this);
        //RandomizeData();
        truck.SetUpTruck();

        truck.trucksCondition.OnZeroCondition += ReturnObjectsToPool;

        followTypeStateController.ChangeState(EnemyStateDictionary.stateDictionary[followType]);

        sideSensorsOffsetVec = sensorsPosition.right * sideSensorsOffset;
        sensorsStartPos      = sensorsPosition.position;
        sensorsRSidePos      = sensorsStartPos + sideSensorsOffsetVec;
        sensorsLSidePos      = sensorsStartPos - sideSensorsOffsetVec;

        truck.trucksCondition.ResetCondition(EnemyHandler.EnemyConditionCalculatedFromPlayerLevelAndComplexity());
    }