コード例 #1
0
ファイル: Player.cs プロジェクト: jstine35/rpgcraft
    void SetRenderInfo()
    {
        if (m_entityRender)
        {
            for (int i = 0; i < 8; ++i)
            {
                int yOffset = (int)m_characterClass * 16;

                m_entityRender.SetFrameInfo(frameGroups[i / 2], i * 16, yOffset, 16, 16);
            }

            // now link frames together
            m_entityRender.LinkNextFrame(frameGroups[0], Up_Cycle1, Up_Cycle2);
            m_entityRender.LinkNextFrame(frameGroups[0], Up_Cycle2, Up_Cycle1);

            m_entityRender.LinkNextFrame(frameGroups[3], Right_Cycle1, Right_Cycle2);
            m_entityRender.LinkNextFrame(frameGroups[3], Right_Cycle2, Right_Cycle1);

            m_entityRender.LinkNextFrame(frameGroups[1], Down_Cycle1, Down_Cycle2);
            m_entityRender.LinkNextFrame(frameGroups[1], Down_Cycle2, Down_Cycle1);

            m_entityRender.LinkNextFrame(frameGroups[2], Left_Cycle1, Left_Cycle2);
            m_entityRender.LinkNextFrame(frameGroups[2], Left_Cycle2, Left_Cycle1);

            m_entityRender.SetGlobalFrameDelay(0.2f);

            m_entityRender.SetCurrentGroup(frameGroups[0]);
        }
    }
コード例 #2
0
    protected override void OnStart()
    {
        base.OnStart();

        EntityRender tickingRender = GetTickingRenderer();

        if (tickingRender != null)
        {
            tickingRender.SetFrameInfo("Main", 0, 0, 32, 32);
            tickingRender.SetCurrentGroup("Main");
        }

        EntityRender explosionRender = GetExplodeRenderer();

        if (explosionRender != null)
        {
            for (int i = 0; i < 12; i++)
            {
                explosionRender.SetFrameInfo("Explode", i * 96, 0, 96, 96);
            }

            for (int i = 0; i < 11; i++)
            {
                explosionRender.LinkNextFrame("Explode", i, i + 1);
            }

            explosionRender.SetGlobalFrameDelay(0.15f);
        }

        StartCoroutine(WaitAndExplode());
    }
コード例 #3
0
    protected override void OnStart()
    {
        base.OnStart();

        if (m_er)
        {
            for (int j = 0; j < 4; ++j)
            {
                for (int i = 0; i < 3; ++i)
                {
                    m_er.SetFrameInfo(frameGroups[j], i * 16, j * 16, 16, 16);
                }
            }

            // now link frames together
            m_er.LinkNextFrame(frameGroups[0], Up_Cycle1, Up_Cycle2);
            m_er.LinkNextFrame(frameGroups[0], Up_Cycle2, Up_Cycle3);
            m_er.LinkNextFrame(frameGroups[0], Up_Cycle3, Up_Cycle1);

            m_er.LinkNextFrame(frameGroups[1], Right_Cycle1, Right_Cycle2);
            m_er.LinkNextFrame(frameGroups[1], Right_Cycle2, Right_Cycle3);
            m_er.LinkNextFrame(frameGroups[1], Right_Cycle3, Right_Cycle1);

            m_er.LinkNextFrame(frameGroups[2], Down_Cycle1, Down_Cycle2);
            m_er.LinkNextFrame(frameGroups[2], Down_Cycle2, Down_Cycle3);
            m_er.LinkNextFrame(frameGroups[2], Down_Cycle3, Down_Cycle1);

            m_er.LinkNextFrame(frameGroups[3], Left_Cycle1, Left_Cycle2);
            m_er.LinkNextFrame(frameGroups[3], Left_Cycle2, Left_Cycle3);
            m_er.LinkNextFrame(frameGroups[3], Left_Cycle3, Left_Cycle1);

            m_er.SetGlobalFrameDelay(0.2f);

            m_er.SetCurrentGroup(frameGroups[RandomManager.Next(0, frameGroups.Length)]);
        }
    }