예제 #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
        }
예제 #2
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)));
        }