public static T CreateInstance <T>(string filename, IRenderObject parent, params object[] args) where T : IRenderObject
        {
            filename = filename.ToLower();
            Type type = typeof(T);

            return(CreateInstance(type, filename, parent, args) as T);
        }
Esempio n. 2
0
 internal void Create(IRenderObject owner)
 {
     this.RenderObject = owner;
     this.enabled_     = true;
     OnCreate();
     OnEnabled();
 }
        public static IRenderObject CreateInstance(Type type, string filename, IRenderObject parent, params object[] args)
        {
            if (instance == null)
            {
                LOG.LogError("'RenderFactory' is null.Please initialize it.");
                return(null);
            }
            filename = filename.ToLower();
            IRenderObject inst = instance.AllocInstance(type, args) as IRenderObject;

            inst.LoadAsset(filename, parent);
            instance.renderObjs.Add(inst);
            return(inst);
        }
 internal static void RemoveRenderObject(IRenderObject obj)
 {
     instance.renderObjs.Remove(obj);
 }