void Update() { GetPositionInClickable(); if (!pauseInCupol && !pauseInBlackHole) { if (liveTime == 0) { currentLiveState = AlienLiveState.Die; return; } if (landWasChanged && currentMovementState != AlienMovementState.Charged && currentMovementState != AlienMovementState.Expulsion && currentMovementState != AlienMovementState.Jump) { landWasChanged = false; //UpdateIgnoreWall(); FindFountain(); } if (currentLiveState.Equals(AlienLiveState.Alive)) { liveTime -= Time.deltaTime; } liveTime = Mathf.Max(liveTime, 0); if (currentMovementState == AlienMovementState.MoveToPoint && IsVeryHungry() && currentClickable.IsFountain()) { SetMovementState(AlienMovementState.Charged); currentFountainTarget = null; StopAllCoroutines(); } /* * if (AlienInWall() && !currentMovementState.Equals(AlienMovementState.Jump) && !currentLiveState.Equals(AlienLiveState.Born)) * { * if (currentMovementState.Equals(AlienMovementState.Expulsion)) * { * if (currentClickable != null && currentClickable.IsWall() && currentClickableExpulsion != currentClickable) * { * currentLiveState = AlienLiveState.Die; * return; * } * } * else * { * StopAllCoroutines(); * StartCoroutine(ExpulsionAlien()); * } * }*/ if (currentClickable != null && currentClickable.IsFountain() && currentMovementState.Equals(AlienMovementState.Charged)) { liveTime += Time.deltaTime * GameplayConstants.AlienCoefRateFountain; liveTime = Mathf.Min(liveTime, GameplayConstants.AlienFullLiveTime); currentClickable.UseFountain(); } if (currentMovementState.Equals(AlienMovementState.Charged) && (liveTime == GameplayConstants.AlienFullLiveTime || !currentClickable.FountainExist())) { SetMovementState(AlienMovementState.Free); currentFountainTarget = null; } } }