Пример #1
0
    void FrameStreamGUI()
    {
        int start = m_aimWorld.FrameCount - ShowCount;

        if (start < 0)
        {
            start = 0;
        }

        showTexture = new Texture2D(ShowCount * 20, 20);

        GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));

        SyncDebugData data = GetSyncData(start);

        data.isConflict = true;

        for (int i = start; i < m_aimWorld.FrameCount; i++)
        {
            ShowFrameDataGUI(showTexture, i, i - start);
        }

        showTexture.Apply();
        GUILayout.Box(showTexture);

        GUILayout.Label(m_aimWorld.FrameCount.ToString());

        GUILayout.EndHorizontal();
    }
Пример #2
0
    Texture2D ChangeShowTexture(Texture2D tex, int index, SyncDebugData data)
    {
        if (data.AffirmMsgCount > 0)
        {
            SetColor(tex, index, 1, Color.grey);
        }
        else
        {
            SetColor(tex, index, 1, Color.green);
        }

        if (data.isAllMessage)
        {
            SetColor(tex, index, 2, Color.green);
        }
        else
        {
            SetColor(tex, index, 2, Color.grey);
        }

        //3位置给重计算
        if (data.RecalcCount == 0)
        {
            SetColor(tex, index, 3, Color.grey);
        }
        else if (data.RecalcCount == 0)
        {
            SetColor(tex, index, 3, Color.blue);
        }
        else
        {
            SetColor(tex, index, 3, Color.red);
        }

        //4 位置 给特殊位置
        if (data.PursueCount > 0)
        {
            SetColor(tex, index, 4, Color.yellow);
        }
        else
        {
            SetColor(tex, index, 4, Color.green);
        }

        //冲突提示位
        if (data.isConflict)
        {
            SetColor(tex, index, 4, Color.red);
        }

        //SetColor(tex, 1, Color.grey);
        //SetColor(tex, 2, Color.green);
        //SetColor(tex, 3, Color.red);
        //SetColor(tex, 4, Color.blue);

        tex.Apply();

        return(tex);
    }
Пример #3
0
 public SyncDebugData GetSyncData(int frame)
 {
     if (m_dataDict.ContainsKey(frame))
     {
         return(m_dataDict[frame]);
     }
     else
     {
         SyncDebugData data = new SyncDebugData();
         m_dataDict.Add(frame, data);
         return(data);
     }
 }
Пример #4
0
    void ReceviceRecalc(params object[] objs)
    {
        SyncDebugData data = GetSyncData((int)objs[0]);

        data.RecalcCount++;
    }
Пример #5
0
    void ReceviceConflict(params object[] objs)
    {
        SyncDebugData data = GetSyncData((int)objs[0]);

        data.isConflict = true;
    }
Пример #6
0
    void ReceviceAllMsg(params object[] objs)
    {
        SyncDebugData data = GetSyncData((int)objs[0]);

        data.isAllMessage = true;
    }
Пример #7
0
    void ReceviceCommandMsg(CommandComponent cmd, params object[] objs)
    {
        SyncDebugData data = GetSyncData(cmd.frame);

        data.CommandList.Add(cmd);
    }
Пример #8
0
    void ReceviceSyncEntity(SyncEntityMsg msg, params object[] objs)
    {
        SyncDebugData data = GetSyncData(msg.frame);

        data.SyncEntityCount++;
    }
Пример #9
0
    void ReceviceAffirmMsg(AffirmMsg msg, params object[] objs)
    {
        SyncDebugData data = GetSyncData(msg.index);

        data.AffirmMsgCount++;
    }
Пример #10
0
    void ReceviceChangeSingletonCompMsg(ChangeSingletonComponentMsg msg, params object[] objs)
    {
        SyncDebugData data = GetSyncData(msg.frame);

        data.ChangeSingletonCompCount++;
    }
Пример #11
0
    void RecevicePursueMsg(PursueMsg msg, params object[] objs)
    {
        SyncDebugData data = GetSyncData(msg.frame);

        data.PursueCount++;
    }
Пример #12
0
    void ReceviceStartSyncMsg(StartSyncMsg msg, params object[] objs)
    {
        SyncDebugData data = GetSyncData(msg.frame);

        data.StartSyncMsgCount++;
    }
Пример #13
0
    void ShowFrameDataGUI(Texture2D tex, int frame, int index)
    {
        SyncDebugData data = GetSyncData(frame);

        ChangeShowTexture(tex, index, data);
    }