Ejemplo n.º 1
0
        public static void DefineVariable(string variableName, string groupName)
        {
#if UNITY_EDITOR
            if (!VarTracer.Instance.groups.ContainsKey(groupName))
            {
                var body = new VarTracerGroup(groupName);
                body.VariableDict[variableName]      = new VarTracerVariable(variableName, groupName);
                VarTracer.Instance.groups[groupName] = body;
            }

            var variableDict = VarTracer.Instance.groups[groupName].VariableDict;
            if (!variableDict.ContainsKey(variableName))
            {
                variableDict[variableName] = new VarTracerVariable(variableName, groupName);
            }
#endif
        }
Ejemplo n.º 2
0
        public static void DefineEvent(string eventName, string groupName)
        {
#if UNITY_EDITOR
            if (string.IsNullOrEmpty(eventName))
            {
                return;
            }

            if (!VarTracer.Instance.groups.ContainsKey(groupName))
            {
                var body = new VarTracerGroup(groupName);
                VarTracer.Instance.groups[groupName] = body;
            }

            if (!VarTracer.Instance.groups[groupName].EventInfos.ContainsKey(eventName))
            {
                VarTracer.Instance.groups[groupName].RegistEvent(eventName);
            }
#endif
        }
Ejemplo n.º 3
0
        public static void UpdateVariable(string groupName, string variableName, long timeStamp, float value)
        {
            if (!VarTracerWindow.isVarTracerStart())
            {
                return;
            }
            if (!VarTracer.Instance.groups.ContainsKey(groupName))
            {
                var body = new VarTracerGroup(groupName);
                body.VariableDict[variableName]      = new VarTracerVariable(variableName, groupName);
                VarTracer.Instance.groups[groupName] = body;
            }

            var variableDict = VarTracer.Instance.groups[groupName].VariableDict;

            if (!variableDict.ContainsKey(variableName))
            {
                variableDict[variableName] = new VarTracerVariable(variableName, groupName);
            }
            variableDict[variableName].InsertValue(new VarDataInfo(value, VarTracerNet.Instance.GetCurrentFrameFromTimestamp(timeStamp)));
        }
Ejemplo n.º 4
0
        public static void SendEvent(string groupName, long timeStamp, string eventName, float duration = 0)
        {
            if (!VarTracerWindow.isVarTracerStart())
            {
                return;
            }

            if (!VarTracer.Instance.groups.ContainsKey(groupName))
            {
                var body = new VarTracerGroup(groupName);
                VarTracer.Instance.groups[groupName] = body;
            }

            var eventInfo = VarTracer.Instance.groups[groupName].EventInfos;

            if (!eventInfo.ContainsKey(eventName))
            {
                VarTracer.Instance.groups[groupName].RegistEvent(eventName);
            }

            eventInfo[eventName].EventDataList.Add(new EventData(timeStamp, eventName, duration));
        }