// Update is called once per frame void Update() { timer.Update(); if (timer.Time < 0.2f) { return; } if (controller.GetInput(LZFight.LZFIGHTERINPUTEVENT.UP).GetDown()) { current--; if (current < 0) { current = buttons.Count - 1; } buttons[current].Select(); timer.Reset(); } else if (controller.GetInput(LZFight.LZFIGHTERINPUTEVENT.DOWN).GetDown()) { current++; if (current >= buttons.Count) { current = 0; } buttons[current].Select(); timer.Reset(); } if (controller.GetInput(LZFight.LZFIGHTERINPUTEVENT.ATTACK).Get()) { buttons[current].OnSubmit(null); } }
public void OnStart(bool jump = false) { // ADD SCRIPT stateScriptHandle = fighter.Machine.AddScript(scripts); if (isShortcut) { fighter.stateMachine.JumpToState(targetState); return; } time.Reset(); if (containedNodes.Count <= 0) { currentData = UnityEngine.Object.Instantiate(data); currentData.Initialize(fighter); currentData.Invert = invert; currentData.OnStart(); } else { if (!jump) { machine.PushState(startState); } } }
public override void Kill(Entity attacker) { this.attacker = attacker; explode.Start(); explode.Reset(); particles.Start(); }
public static FrameTimer Create(Action callback, int duration = 1, int loop = -1) { FrameTimer timer = s_poolTimer.Get(); timer.Reset(callback, duration, loop); timer.Start(); return(timer); }
public void Play(int from = 0, int to = -1) { timer.Reset(); timer.Start(); frame = from; if (to >= 0) { end = to + 1; } else { end = frames.Length; } UpdateFrame(); }
private void shoot() { if (!Input.GetMouseButton(0)) { _shotTimer.Reset(); return; } if (_shotTimer.CheckThisFrame()) { AudioManager.instance.PlaySFX(SoundEffect.Shoot1); Instantiate(bulletToFire, muzzlePoint.position, muzzlePoint.rotation); } }
private void dash() { if (Input.GetKeyDown(KeyCode.Space) && _dashTimer == null && _dashCooldownTimer.CheckThisFrame()) { AudioManager.instance.PlaySFX(SoundEffect.PlayerDash); _currentMoveSpeed = dashSpeed; _dashTimer = new FrameTimer(dashDuration, false); animator.SetTrigger("dash"); PlayerHealthController.instance.MakeInvulnerable(dashInvulnDuration, false); } if (_dashTimer != null && _dashTimer.CheckThisFrame()) { _currentMoveSpeed = moveSpeed; _dashTimer = null; _dashCooldownTimer.Reset(); } }
public void AddGuardBreak(float guard, Vector3 position) { if (onReceiveDamage != null) { foreach (var handle in onReceiveDamage.GetInvocationList()) { if ((bool)handle.DynamicInvoke(position)) { return; } } } currentGuard += guard; if (currentGuard > maxGuard) { fighter.AddScript(breakSound); blockHandler.Disabled = true; breakTimer.Reset(); currentGuard = 0; } currentGuard = Mathf.Clamp(currentGuard, 0, maxGuard); }
protected override void OnEnemySpawn() { //Debug.Break(); AlphaCalculator.Reset(); HealthBar.Alpha = 0f; }
public override void Kill(Entity attacker) { owner = attacker; explode.Reset(); explode.Start(); }