Example #1
0
    void OnProcess(ProcessFrameEvent e)
    {
        if (!m_started)
        {
            return;
        }

        PlayerCommandsBase.GetCommandsData data = new PlayerCommandsBase.GetCommandsData(e.frame, e.status);
        m_playerCommands.GetCommands(data);

        CheckGrounded();

        ProcessDirection(data.moveDir);

        ProcessJump(data.jumpPressed);

        if (data.kickPressed)
        {
            Kick();
        }
        m_kickTimer -= Time.deltaTime;

        if (data.actionPressed)
        {
            Action();
        }
        m_actionTimer -= Time.deltaTime;
    }
Example #2
0
    void OnFrameBackward(ProcessFrameEvent e)
    {
        //the last line is for the player
        for (int i = 0; i < m_timelines.Count - 1; i++)
        {
            if (GetTimelineFirstFrame(i) < e.frame && GetTimelineLastFrame(i) >= e.frame)
            {
                SpawnClone(i, e.frame);
            }
        }

        List <int> clonesToRemove = new List <int>();

        foreach (var clone in m_instancedClones)
        {
            if (GetTimelineFirstFrame(clone.Key) > e.frame)
            {
                clonesToRemove.Add(clone.Key);
            }
        }
        foreach (var i in clonesToRemove)
        {
            m_instancedClones.Remove(i);
        }
    }
Example #3
0
    void OnFrame(ProcessFrameEvent e)
    {
        switch (e.status)
        {
        case FrameStatus.Playing:
        case FrameStatus.FastForward:
            OnForwardFrame(e);
            break;

        case FrameStatus.FastBackward:
            OnBackwardFrame(e);
            break;

        default:
            break;
        }
    }
Example #4
0
    void OnFrame(ProcessFrameEvent e)
    {
        switch (e.status)
        {
        case FrameStatus.Pause:
            m_pauseIcon.SetActive(true);
            m_playIcon.SetActive(false);
            m_fastForwardIcon.SetActive(false);
            m_fastBackwardIcon.SetActive(false);
            break;

        case FrameStatus.Playing:
            m_pauseIcon.SetActive(false);
            m_playIcon.SetActive(true);
            m_fastForwardIcon.SetActive(false);
            m_fastBackwardIcon.SetActive(false);
            break;

        case FrameStatus.FastForward:
            m_pauseIcon.SetActive(false);
            m_playIcon.SetActive(false);
            m_fastForwardIcon.SetActive(true);
            m_fastBackwardIcon.SetActive(false);
            break;

        case FrameStatus.FastBackward:
            m_pauseIcon.SetActive(false);
            m_playIcon.SetActive(false);
            m_fastForwardIcon.SetActive(false);
            m_fastBackwardIcon.SetActive(true);
            break;
        }

        var scale = m_timerFransform.localScale;

        scale.x = e.time / e.maxTime;
        m_timerFransform.localScale = scale;
    }
Example #5
0
 void OnFrame(ProcessFrameEvent e)
 {
     CopyPlayerInfos();
 }
Example #6
0
 void OnBackwardFrame(ProcessFrameEvent e)
 {
 }
Example #7
0
 void OnForwardFrame(ProcessFrameEvent e)
 {
     m_currentFrame.pos = transform.position;
     m_currentFrame.rot = transform.rotation.eulerAngles.z;
 }