static int ResetNormalGameSpeed(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.BaseComponent));
         obj.ResetNormalGameSpeed();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_GameVersion(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.GameVersion = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index GameVersion on a nil value" : e.Message));
        }
    }
    static int set_InternalApplicationVersion(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.InternalApplicationVersion = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index InternalApplicationVersion on a nil value" : e.Message));
        }
    }
    static int set_GameSpeed(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.GameSpeed = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index GameSpeed on a nil value" : e.Message));
        }
    }
    static int get_GameVersion(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            string ret = obj.GameVersion;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index GameVersion on a nil value" : e.Message));
        }
    }
    static int set_NeverSleep(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.NeverSleep = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index NeverSleep on a nil value" : e.Message));
        }
    }
    static int set_EditorLanguage(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj  = (UnityGameFramework.Runtime.BaseComponent)o;
            GameFramework.Localization.Language      arg0 = (GameFramework.Localization.Language)ToLua.CheckObject(L, 2, typeof(GameFramework.Localization.Language));
            obj.EditorLanguage = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index EditorLanguage on a nil value" : e.Message));
        }
    }
    static int set_EditorResourceHelper(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj  = (UnityGameFramework.Runtime.BaseComponent)o;
            GameFramework.Resource.IResourceManager  arg0 = (GameFramework.Resource.IResourceManager)ToLua.CheckObject(L, 2, typeof(GameFramework.Resource.IResourceManager));
            obj.EditorResourceHelper = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index EditorResourceHelper on a nil value" : e.Message));
        }
    }
    static int get_NeverSleep(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            bool ret = obj.NeverSleep;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index NeverSleep on a nil value" : e.Message));
        }
    }
    static int get_FrameRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            int ret = obj.FrameRate;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index FrameRate on a nil value" : e.Message));
        }
    }
    static int get_EditorResourceHelper(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            GameFramework.Resource.IResourceManager  ret = obj.EditorResourceHelper;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index EditorResourceHelper on a nil value" : e.Message));
        }
    }
    static int get_EditorLanguage(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.BaseComponent obj = (UnityGameFramework.Runtime.BaseComponent)o;
            GameFramework.Localization.Language      ret = obj.EditorLanguage;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index EditorLanguage on a nil value" : e.Message));
        }
    }
Example #13
0
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent)
            {
                Log.Fatal();
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();

            m_ResourceManager = m_EditorResourceMode ? baseComponent.EditorResourceHelper : GameFrameworkEntry.GetModule <IResourceManager>();

            m_ResourceManager.ResourceInitComplete      += OnResourceInitComplete;
            m_ResourceManager.VersionListUpdateSuccess  += OnVersionListUpdateSuccess;
            m_ResourceManager.ResouceCheckComplete      += OnResourceCheckComplete;
            m_ResourceManager.ResourceUpdaterStart      += OnResourceUpdateStart;
            m_ResourceManager.ResourceUpdateSuccess     += OnResourceUpdateSuccess;
            m_ResourceManager.ResourceUpdateAllComplete += OnresourceUpdateAllComplete;

            m_ResourceManager.SetReadOnlyPath(Application.streamingAssetsPath);
            if (m_ReadWritePathType == ReadWritePathType.TemporaryCache)
            {
                m_ResourceManager.SetReadWritePath(Application.temporaryCachePath);
            }
            else
            {
                if (m_ReadWritePathType == m_ReadWritePathType.Unspecified)
                {
                    m_ReadWritePathType = m_ReadWritePathType.PersistentData;
                }
                m_ResourceManager.SetReadWritePath(Application.persistentDataPath);
            }

            SetResourceMode(m_ResourceMode);
            m_ResourceManager.SetDownloadManager(GameFrameworkEntry.GetModule <IDownloadManager>());
            m_ResourceManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
            m_ResourceManager.AssetAutoReleaseInterval = m_AssetAutoReleaseInterval;
            m_ResourceManager.AssetCapacity            = m_AssetCapacity;
            m_ResourceManager.AssetPriority            = m_AssetPriority;
            m_ResourceManager.ResourceCapacity         = m_ResourceCapacity;
            m_ResourceManager.ResourceExpireTime       = m_ResourceExpireTime;
            if (m_ResourceMode == ResourceMode.Updateable)
            {
                m_ResourceManager.UpdatePrefixUri  = m_UpdatePrefixUri;
                m_ResourceManager.UpdateRetryCount = m_UpdateRetryCount;
            }

            m_ResourceHelper      = Helper.CreateHelper(m_ResourceHelperTypeName, m_CustomResourceHelper);
            m_ResourceHelper.name = string.Format("Resource Helper");
            Transform transform = m_ResourceHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale = Vector3.one;

            m_ResourceManager.SetResourceHelper(m_ResourceHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("Load resource Agent Instance")).transform;
                m_InstanceRoot.SetParent(GameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            for (int i = 0; i < m_LoadResourceAgentHelperCount; i++)
            {
                AddLoadResourceAgentHelper(i);
            }
        }
        private void Start()
        {
            _baseComponent = GameEntry.GetComponent <BaseComponent>();
            if (_baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }
            _eventComponent = GameEntry.GetComponent <EventComponent>();
            if (_eventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            m_EditorResourceMode = _baseComponent.EditorResourceMode;
            m_ResourceManager    = m_EditorResourceMode ? _baseComponent.EditorResourceHelper : GameFrameworkEntry.GetModule <IResourceManager>();
            if (m_ResourceManager == null)
            {
                Log.Fatal("Resource manager is invalid.");
                return;
            }
            m_ResourceManager.ResourceInitComplete += OnResourceInitComplete;

            m_ResourceManager.SetReadOnlyPath(Application.streamingAssetsPath);
            if (m_ReadWritePathType == ReadWritePathType.TemporaryCache)
            {
                m_ResourceManager.SetReadWritePath(Application.temporaryCachePath);
            }
            else
            {
                if (m_ReadWritePathType == ReadWritePathType.Unspecified)
                {
                    m_ReadWritePathType = ReadWritePathType.PersistentData;
                }

                m_ResourceManager.SetReadWritePath(Application.persistentDataPath);
            }

            if (m_EditorResourceMode)
            {
                return;
            }

            SetResourceMode(m_ResourceMode);
            m_ResourceManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
            m_ResourceManager.AssetAutoReleaseInterval    = m_AssetAutoReleaseInterval;
            m_ResourceManager.AssetCapacity               = m_AssetCapacity;
            m_ResourceManager.AssetExpireTime             = m_AssetExpireTime;
            m_ResourceManager.AssetPriority               = m_AssetPriority;
            m_ResourceManager.ResourceAutoReleaseInterval = m_ResourceAutoReleaseInterval;
            m_ResourceManager.ResourceCapacity            = m_ResourceCapacity;
            m_ResourceManager.ResourceExpireTime          = m_ResourceExpireTime;
            m_ResourceManager.ResourcePriority            = m_ResourcePriority;

            m_ResourceHelper = Helper.CreateHelper(m_ResourceHelperTypeName, m_CustomResourceHelper);
            if (m_ResourceHelper == null)
            {
                Log.Error("Can not create resource helper.");
                return;
            }

            m_ResourceHelper.name = string.Format("Resource Helper");
            Transform transform = m_ResourceHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale = Vector3.one;

            m_ResourceManager.SetResourceHelper(m_ResourceHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("Load Resource Agent Instances")).transform;
                m_InstanceRoot.SetParent(gameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            for (int i = 0; i < m_LoadResourceAgentHelperCount; i++)
            {
                AddLoadResourceAgentHelper(i);
            }
        }
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();
            if (m_EventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            bool useEditorResources = baseComponent.EditorResourceMode;

            m_ResourceManager = useEditorResources ? baseComponent.EditorResourceHelper : GameFrameworkEntry.GetModule <IResourceManager>();
            if (m_ResourceManager == null)
            {
                Log.Fatal("Resource manager is invalid.");
                return;
            }

            m_ResourceManager.ResourceInitComplete      += OnResourceInitComplete;
            m_ResourceManager.VersionListUpdateSuccess  += OnVersionListUpdateSuccess;
            m_ResourceManager.VersionListUpdateFailure  += OnVersionListUpdateFailure;
            m_ResourceManager.ResourceCheckComplete     += OnResourceCheckComplete;
            m_ResourceManager.ResourceUpdateStart       += OnResourceUpdateStart;
            m_ResourceManager.ResourceUpdateChanged     += OnResourceUpdateChanged;
            m_ResourceManager.ResourceUpdateSuccess     += OnResourceUpdateSuccess;
            m_ResourceManager.ResourceUpdateFailure     += OnResourceUpdateFailure;
            m_ResourceManager.ResourceUpdateAllComplete += OnResourceUpdateAllComplete;

            m_ResourceManager.SetReadOnlyPath(Application.streamingAssetsPath);
            m_ResourceManager.SetReadWritePath(Application.temporaryCachePath);

            if (!useEditorResources)
            {
                SetResourceMode(m_ResourceMode);
                m_ResourceManager.SetDownloadManager(GameFrameworkEntry.GetModule <IDownloadManager>());
                m_ResourceManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
                m_ResourceManager.ResourceCapacity = m_ResourceCapacity;
                if (m_ResourceMode == ResourceMode.Updatable)
                {
                    m_ResourceManager.UpdateRetryCount = m_UpdateRetryCount;
                }

                if (m_ResourceHelper == null)
                {
                    m_ResourceHelper      = (new GameObject()).AddComponent <DefaultResourceHelper>();
                    m_ResourceHelper.name = string.Format("Resource Helper");
                    Transform transform = m_ResourceHelper.transform;
                    transform.SetParent(this.transform);
                    transform.localScale = Vector3.one;
                }

                m_ResourceManager.SetResourceHelper(m_ResourceHelper);

                if (m_InstanceRoot == null)
                {
                    m_InstanceRoot = (new GameObject("Load Resource Agent Instances")).transform;
                    m_InstanceRoot.SetParent(gameObject.transform);
                }

                for (int i = 0; i < m_LoadResourceAgentHelperCount; i++)
                {
                    LoadResourceAgentHelperBase helper = null;
                    if (m_LoadResourceAgentHelperTemplate != null)
                    {
                        helper = Instantiate(m_LoadResourceAgentHelperTemplate);
                    }
                    else
                    {
                        helper = (new GameObject()).AddComponent <DefaultLoadResourceAgentHelper>();
                    }

                    helper.name = string.Format("Load Resource Agent Helper - {0}", i.ToString());
                    Transform transform = helper.transform;
                    transform.SetParent(m_InstanceRoot);
                    transform.localScale = Vector3.one;
                    m_ResourceManager.AddLoadResourceAgentHelper(helper);
                }
            }
        }
Example #16
0
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();
            if (m_EventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            m_EditorResourceMode = baseComponent.EditorResourceMode;
            m_ResourceManager    = m_EditorResourceMode ? baseComponent.EditorResourceHelper : GameFrameworkEntry.GetModule <IResourceManager>();
            if (m_ResourceManager == null)
            {
                Log.Fatal("Resource manager is invalid.");
                return;
            }

            m_ResourceManager.ResourceUpdateStart   += OnResourceUpdateStart;
            m_ResourceManager.ResourceUpdateChanged += OnResourceUpdateChanged;
            m_ResourceManager.ResourceUpdateSuccess += OnResourceUpdateSuccess;
            m_ResourceManager.ResourceUpdateFailure += OnResourceUpdateFailure;

            m_ResourceManager.SetReadOnlyPath(Application.streamingAssetsPath);
            if (m_ReadWritePathType == ReadWritePathType.TemporaryCache)
            {
                m_ResourceManager.SetReadWritePath(Application.temporaryCachePath);
            }
            else
            {
                if (m_ReadWritePathType == ReadWritePathType.Unspecified)
                {
                    m_ReadWritePathType = ReadWritePathType.PersistentData;
                }

                m_ResourceManager.SetReadWritePath(Application.persistentDataPath);
            }

            if (m_EditorResourceMode)
            {
                return;
            }

            SetResourceMode(m_ResourceMode);
            m_ResourceManager.SetDownloadManager(GameFrameworkEntry.GetModule <IDownloadManager>());
            m_ResourceManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
            m_ResourceManager.AssetAutoReleaseInterval    = m_AssetAutoReleaseInterval;
            m_ResourceManager.AssetCapacity               = m_AssetCapacity;
            m_ResourceManager.AssetExpireTime             = m_AssetExpireTime;
            m_ResourceManager.AssetPriority               = m_AssetPriority;
            m_ResourceManager.ResourceAutoReleaseInterval = m_ResourceAutoReleaseInterval;
            m_ResourceManager.ResourceCapacity            = m_ResourceCapacity;
            m_ResourceManager.ResourceExpireTime          = m_ResourceExpireTime;
            m_ResourceManager.ResourcePriority            = m_ResourcePriority;
            if (m_ResourceMode == ResourceMode.Updatable)
            {
                m_ResourceManager.UpdatePrefixUri             = m_UpdatePrefixUri;
                m_ResourceManager.UpdateFileCacheLength       = m_UpdateFileCacheLength;
                m_ResourceManager.GenerateReadWriteListLength = m_GenerateReadWriteListLength;
                m_ResourceManager.UpdateRetryCount            = m_UpdateRetryCount;
            }

            m_ResourceHelper = Helper.CreateHelper(m_ResourceHelperTypeName, m_CustomResourceHelper);
            if (m_ResourceHelper == null)
            {
                Log.Error("Can not create resource helper.");
                return;
            }

            m_ResourceHelper.name = "Resource Helper";
            Transform transform = m_ResourceHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale = Vector3.one;

            m_ResourceManager.SetResourceHelper(m_ResourceHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("Load Resource Agent Instances")).transform;
                m_InstanceRoot.SetParent(gameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            for (int i = 0; i < m_LoadResourceAgentHelperCount; i++)
            {
                AddLoadResourceAgentHelper(i);
            }
        }
Example #17
0
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();
            if (m_EventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            m_EditorResourceMode = baseComponent.EditorResourceMode;
            m_ResourceManager    = m_EditorResourceMode ? baseComponent.EditorResourceHelper : GameFrameworkEntry.GetModule <IResourceManager>();
            if (m_ResourceManager == null)
            {
                Log.Fatal("Resource manager is invalid.");
                return;
            }

            m_ResourceManager.ResourceInitComplete      += OnResourceInitComplete;
            m_ResourceManager.VersionListUpdateSuccess  += OnVersionListUpdateSuccess;
            m_ResourceManager.VersionListUpdateFailure  += OnVersionListUpdateFailure;
            m_ResourceManager.ResourceCheckComplete     += OnResourceCheckComplete;
            m_ResourceManager.ResourceUpdateStart       += OnResourceUpdateStart;
            m_ResourceManager.ResourceUpdateChanged     += OnResourceUpdateChanged;
            m_ResourceManager.ResourceUpdateSuccess     += OnResourceUpdateSuccess;
            m_ResourceManager.ResourceUpdateFailure     += OnResourceUpdateFailure;
            m_ResourceManager.ResourceUpdateAllComplete += OnResourceUpdateAllComplete;

            m_ResourceManager.SetReadOnlyPath(Application.streamingAssetsPath);
            m_ResourceManager.SetReadWritePath(Application.temporaryCachePath);

            if (m_EditorResourceMode)
            {
                return;
            }

            SetResourceMode(m_ResourceMode);
            m_ResourceManager.SetDownloadManager(GameFrameworkEntry.GetModule <IDownloadManager>());
            m_ResourceManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
            m_ResourceManager.ResourceCapacity = m_ResourceCapacity;
            if (m_ResourceMode == ResourceMode.Updatable)
            {
                m_ResourceManager.UpdatePrefixUri  = m_UpdatePrefixUri;
                m_ResourceManager.UpdateRetryCount = m_UpdateRetryCount;
            }

            m_ResourceHelper = Utility.Helper.CreateHelper(m_ResourceHelperTypeName, m_CustomResourceHelper);
            if (m_ResourceHelper == null)
            {
                Log.Error("Can not create resource helper.");
                return;
            }

            m_ResourceHelper.name = string.Format("Resource Helper");
            Transform transform = m_ResourceHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale = Vector3.one;

            m_ResourceManager.SetResourceHelper(m_ResourceHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("Load Resource Agent Instances")).transform;
                m_InstanceRoot.SetParent(gameObject.transform);
            }

            for (int i = 0; i < m_LoadResourceAgentHelperCount; i++)
            {
                AddLoadResourceAgentHelper(i);
            }
        }
Example #18
0
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();
            if (m_EventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            if (baseComponent.EditorResourceMode)
            {
                m_UIManager.SetResourceManager(baseComponent.EditorResourceHelper);
            }
            else
            {
                m_UIManager.SetResourceManager(GameFrameworkEntry.GetModule <IResourceManager>());
            }

            m_UIManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());
            m_UIManager.InstanceAutoReleaseInterval = m_InstanceAutoReleaseInterval;
            m_UIManager.InstanceCapacity            = m_InstanceCapacity;
            m_UIManager.InstanceExpireTime          = m_InstanceExpireTime;
            m_UIManager.InstancePriority            = m_InstancePriority;

            UIFormHelperBase uiFormHelper = Helper.CreateHelper(m_UIFormHelperTypeName, m_CustomUIFormHelper);

            if (uiFormHelper == null)
            {
                Log.Error("Can not create UI form helper.");
                return;
            }

            uiFormHelper.name = string.Format("UI Form Helper");
            Transform transform = uiFormHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale = Vector3.one;

            m_UIManager.SetUIFormHelper(uiFormHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("UI Form Instances")).transform;
                m_InstanceRoot.SetParent(gameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            m_InstanceRoot.gameObject.layer = LayerMask.NameToLayer("UI");

            for (int i = 0; i < m_UIGroups.Length; i++)
            {
                if (!AddUIGroup(m_UIGroups[i].Name, m_UIGroups[i].Depth))
                {
                    Log.Warning("Add UI group '{0}' failure.", m_UIGroups[i].Name);
                    continue;
                }
            }
        }
Example #19
0
        private void Start()
        {
            BaseComponent baseComponent = GameEntry.GetComponent <BaseComponent>();

            if (baseComponent == null)
            {
                Log.Fatal("Base component is invalid.");
                return;
            }

            m_EventComponent = GameEntry.GetComponent <EventComponent>();
            if (m_EventComponent == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            if (baseComponent.EditorResourceMode)
            {
                m_EntityManager.SetResourceManager(baseComponent.EditorResourceHelper);
            }
            else
            {
                m_EntityManager.SetResourceManager(GameFrameworkEntry.GetModule <IResourceManager>());
            }

            m_EntityManager.SetObjectPoolManager(GameFrameworkEntry.GetModule <IObjectPoolManager>());

            EntityHelperBase entityHelper = Helper.CreateHelper(m_EntityHelperTypeName, m_CustomEntityHelper);

            if (entityHelper == null)
            {
                Log.Error("Can not create entity helper.");
                return;
            }

            entityHelper.name = "Entity Helper";
            Transform transform = entityHelper.transform;

            transform.SetParent(this.transform);
            transform.localScale    = Vector3.one;
            transform.localPosition = Vector3.zero;

            m_EntityManager.SetEntityHelper(entityHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = (new GameObject("Entity Instances")).transform;
                m_InstanceRoot.SetParent(gameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            for (int i = 0; i < m_EntityGroups.Length; i++)
            {
                if (!AddEntityGroup(m_EntityGroups[i].Name, m_EntityGroups[i].InstanceAutoReleaseInterval, m_EntityGroups[i].InstanceCapacity, m_EntityGroups[i].InstanceExpireTime, m_EntityGroups[i].InstancePriority))
                {
                    Log.Warning("Add entity group '{0}' failure.", m_EntityGroups[i].Name);
                    continue;
                }
            }
        }