示例#1
0
        private static void Register(CCommand cmd)
        {
            if (ccwrapperMap.ContainsKey(cmd.Name))
            {
                // duplicate name
                Debug.LogWarning($"duplicate cvar or ccmd name: {cmd.Name}");
                return;
            }
            var wrapper = new CCWrapper()
            {
                type = CCWrapper.WrappedType.CCmd,
                cmd  = cmd,
            };

            ccwrapperMap[wrapper.Name] = wrapper;
            ccwrapperList.Add(wrapper);
        }
示例#2
0
        private static void Register(CVariable cvar)
        {
            if (ccwrapperMap.ContainsKey(cvar.Name))
            {
                // duplicate name
                Debug.LogWarning($"duplicate cvar or ccmd name: {cvar.Name}");
                return;
            }
            var wrapper = new CCWrapper()
            {
                type = CCWrapper.WrappedType.CVar,
                cvar = cvar,
            };

            ccwrapperMap[wrapper.Name] = wrapper;
            ccwrapperList.Add(wrapper);
        }