Example #1
0
        public Var <T> SetupVar <T>(string fragment, T val, Action <IVar> watcher)
        {
            string  key = GetSubKey(fragment);
            Var <T> v   = Obj.Vars.AddVar <T>(key, val);

            if (v != null)
            {
                if (watcher != null && v.AddVarWatcher(this, watcher) == null)
                {
                    Error("Add Watcher Failed: {0} -> {1}, {2}", this, typeof(T).FullName, fragment);
                }
            }
            return(v);
        }