void OnEnable()
    {
        EditorApplication.update += Update;
        if (VarTracer.Instance != null)
        {
            if (VarTracer.Instance.Graphs.Count == 0)
                VarTracer.AddChannel();

            bool constainsCamera = VarTracer.Instance.VariableBodys.ContainsKey("Camera");
            if (!constainsCamera || VarTracer.Instance.VariableBodys["Camera"].VariableDict.Count == 0)
            {
                VarTracerHandler.DefineVariable("CameraV_X", "Camera");
                VarTracerHandler.DefineVariable("CameraV_Y", "Camera");
                VarTracerHandler.DefineVariable("CameraV_Z", "Camera");
                VarTracerHandler.DefineVariable("CameraV_T", "Camera");

                VarTracerHandler.DefineVariable("PlayerV_X", "Player");
                VarTracerHandler.DefineVariable("PlayerV_Y", "Player");
                VarTracerHandler.DefineVariable("PlayerV_Z", "Player");
                VarTracerHandler.DefineVariable("CameraV_T", "Camera");

                VarTracerHandler.DefineVariable("FPS", "System");

                VarTracerHandler.DefineEvent("JUMP","Camera");
                VarTracerHandler.DefineVariable("NpcV_X", "Npc");
                VarTracerHandler.DefineVariable("NpcV_Y", "Npc");
                VarTracerHandler.DefineVariable("NpcV_Z", "Npc");
                VarTracerHandler.DefineVariable("NpcV_T", "Npc");
            }
        }

        VarTracer.AddChannel();
        VarTracer.AddChannel();
    }
Example #2
0
    public void Upate()
    {
        if (Time.realtimeSinceStartup - m_lastHandleJsonTime >= VarTracerConst.HANDLE_JASON_INTERVAL)
        {
            m_lastHandleJsonTime = Time.realtimeSinceStartup;
            if (VartracerJsonMsgList.Count > 0)
            {
                Thread mThread = new Thread(new ParameterizedThreadStart(handleMsgAsyn));
                lock (_locker)
                {
                    mThread.Start(VartracerJsonMsgList.ToArray());
                    VartracerJsonMsgList.Clear();
                }
            }

            if (vartracerJsonObj.readerFlag)
            {
                var result = vartracerJsonObj.readResovleJsonResult();
                if (result != null)
                {
                    foreach (var vjt in result)
                    {
                        VarTracerHandler.ResoloveJsonMsg(vjt);
                    }
                }
            }
        }
    }