Beispiel #1
0
 private void Start()
 {
     if (_startSpawned.Value)
     {
         for (int i = 0; i < _count.Value; i++)
         {
             Spawn();
         }
     }
     else
     {
         _spawnDelay.RestartTimer();
     }
 }
Beispiel #2
0
 public void StartTimer()
 {
     if (restartOnEnterPreviousState)
     {
         targetParameter?.RestartTimer();
     }
 }
Beispiel #3
0
 private void UpdateHunger()
 {
     HungerDecayTimer?.UpdateTime();
     if (HungerDecayTimer.IsFinished && HungerOut.Value > 0)
     {
         damageFeedback.PlayFeedbacks();
         IncrementHunger(-1);
         HungerDecayTimer.RestartTimer();
     }
 }
    public override void Enter()
    {
        base.Enter();

        comboTimer.RestartTimer();
        comboFinishTimer.RestartTimer();

        Vector3 throwDirection;
        var     aimTarget = CurrentTargetRef.Value;

        //If no target, throw forward
        if (aimTarget.SafeIsUnityNull())
        {
            throwDirection = GetMoveDirection().normalized;
        }
        //If find collider, target center bounds, otherwise target transform.
        else
        {
            Collider targetCollider = aimTarget.GetComponent <Collider>();
            Vector3  targetPosition;

            if (targetCollider != null)
            {
                targetPosition = targetCollider.bounds.center;
            }


            else
            {
                targetPosition = aimTarget.position;
            }


            throwDirection = (targetPosition - FirePoint.Value.position).normalized;
        }

        if (Mathf.Approximately(throwDirection.magnitude, 0))
        {
            throwDirection = FirePoint.Value.forward;
        }

        MeatClumpController clump = Instantiate(MeatClumpPrefab);

        clump.transform.position = FirePoint.Value.position;
        clump.SetMoving(ThrowSpeed.Value, throwDirection);
        if (ClumpOverCharged.Value)
        {
            clump.SetOverCharged();
        }

        playerController.OnClumpThrown(throwDirection);
    }
Beispiel #5
0
    private void Start()
    {
        charMotor.CharacterController = this;
        MaxStableDenivelationAngle.Subscribe(OnUpdateMaxStableDenivelationAngle);
        HungerDecayTimer?.RestartTimer();

        FrenzyOut.Subscribe(OnUpdateFrenzy);
        GroundSlamCooldownTimer.StartTimer();

        capsuleStartHeight = charMotor.Capsule.height;
        capsuleStartCenter = charMotor.Capsule.center;
        capsuleStartRadius = charMotor.Capsule.radius;

        UpdateScale(Scale.Value, Scale.Value);
        Scale.Subscribe(UpdateScale);
        IsPlayerDead.Value = false;
    }
 public void StartTimer()
 {
     _timer.RestartTimer();
 }
Beispiel #7
0
 private void AddFrenzy()
 {
     FrenzyDecayTimer.RestartTimer();
     FrenzyOut.Value += 1;
 }