Exemplo n.º 1
0
            public static NMMonoAgent AddMono(GameObject go, Type t)
            {
                NMMono mono = go.AddComponent <NMMono>();

                mono._name       = t.Name;
                mono._agent      = Activator.CreateInstance(t) as NMMonoAgent;
                mono._agent.mono = mono;
                mono._agent.Awake();
                return(mono._agent);
            }
Exemplo n.º 2
0
            public static T AddMono <T>(GameObject go) where T : NMMonoAgent, new()
            {
                NMMono mono = go.AddComponent <NMMono>();

                mono._name       = typeof(T).Name;
                mono._agent      = new T();
                mono._agent.mono = mono;
                mono._agent.Awake();
                return(mono._agent as T);
            }