Exemplo n.º 1
0
    // 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);
        }
    }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
 public override void Kill(Entity attacker)
 {
     this.attacker = attacker;
     explode.Start();
     explode.Reset();
     particles.Start();
 }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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();
    }
Exemplo n.º 6
0
    private void shoot()
    {
        if (!Input.GetMouseButton(0))
        {
            _shotTimer.Reset();
            return;
        }

        if (_shotTimer.CheckThisFrame())
        {
            AudioManager.instance.PlaySFX(SoundEffect.Shoot1);
            Instantiate(bulletToFire, muzzlePoint.position, muzzlePoint.rotation);
        }
    }
Exemplo n.º 7
0
    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();
        }
    }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 protected override void OnEnemySpawn()
 {
     //Debug.Break();
     AlphaCalculator.Reset();
     HealthBar.Alpha = 0f;
 }
Exemplo n.º 10
0
 public override void Kill(Entity attacker)
 {
     owner = attacker;
     explode.Reset();
     explode.Start();
 }