public static void AddCVar(CVar cvar) { if (m_cvars.Exists(c => c.name == cvar.name)) // cvar with the same name already exists { return; } // adjust some parameters first if ("" == cvar.displayName) { cvar.displayName = cvar.name; } // set default value, if it is not set if (null == cvar.defaultValue) { cvar.defaultValue = CVarManager.GetCVarValue(cvar); } // add it to list m_cvars.Add(cvar); }
void Awake() { singleton = this; }