コード例 #1
0
        /// <summary>
        /// Associate any unallocated assets to this resource. Return true if something changes.
        /// </summary>
        /// <returns>True if the prototype was in some way modified</returns>
        public bool AssociateAssets()
        {
            bool isModified = false;

            #if UNITY_EDITOR
            if (m_detailProtoype == null)
            {
                if (!string.IsNullOrEmpty(m_detailPrototypeFileName))
                {
                    m_detailProtoype = GaiaUtils.GetAsset(m_detailPrototypeFileName, typeof(UnityEngine.GameObject)) as GameObject;
                    if (m_detailProtoype != null)
                    {
                        isModified = true;
                    }
                }
            }

            if (m_detailTexture == null)
            {
                if (!string.IsNullOrEmpty(m_detailTextureFileName))
                {
                    m_detailTexture = GaiaUtils.GetAsset(m_detailTextureFileName, typeof(UnityEngine.Texture2D)) as Texture2D;
                    if (m_detailTexture != null)
                    {
                        isModified = true;
                    }
                }
            }
            #endif

            return(isModified);
        }
コード例 #2
0
        /// <summary>
        /// Associate any unallocated assets to this resource. Return true if something changes.
        /// </summary>
        /// <returns>True if the prototype was in some way modified</returns>
        public bool AssociateAssets()
        {
            bool isModified = false;

            #if UNITY_EDITOR
            if (m_desktopPrefab == null)
            {
                if (!string.IsNullOrEmpty(m_desktopPrefabFileName))
                {
                    m_desktopPrefab = GaiaUtils.GetAsset(m_desktopPrefabFileName, typeof(UnityEngine.GameObject)) as GameObject;
                    if (m_desktopPrefab != null)
                    {
                        isModified = true;
                    }
                }
            }

            if (m_mobilePrefab == null)
            {
                if (!string.IsNullOrEmpty(m_mobilePrefabFileName))
                {
                    m_mobilePrefab = GaiaUtils.GetAsset(m_mobilePrefabFileName, typeof(UnityEngine.GameObject)) as GameObject;
                    if (m_mobilePrefab != null)
                    {
                        isModified = true;
                    }
                }
            }
            #endif
            return(isModified);
        }
コード例 #3
0
        /// <summary>
        /// Associate any unallocated assets to this resource. Return true if something changes.
        /// </summary>
        /// <returns>True if the prototype was in some way modified</returns>
        public bool AssociateAssets()
        {
            bool isModified = false;

            #if UNITY_EDITOR
            if (m_texture == null)
            {
                if (!string.IsNullOrEmpty(m_textureFileName))
                {
                    m_texture = GaiaUtils.GetAsset(m_textureFileName, typeof(UnityEngine.Texture2D)) as Texture2D;
                    if (m_texture != null)
                    {
                        isModified = true;
                    }
                }
            }

            if (m_normal == null)
            {
                if (!string.IsNullOrEmpty(m_normalFileName))
                {
                    m_normal = GaiaUtils.GetAsset(m_normalFileName, typeof(UnityEngine.Texture2D)) as Texture2D;
                    if (m_normal != null)
                    {
                        isModified = true;
                    }
                }
            }
            #endif
            return(isModified);
        }
コード例 #4
0
        /// <summary>
        /// Associate any unallocated assets to this resource. Return true if something changes.
        /// </summary>
        /// <returns>True if the prototype was in some way modified</returns>
        public bool AssociateAssets()
        {
            bool isModified = false;

#if UNITY_EDITOR
            ResourceProtoSpawnExtensionInstance goInstance;
            for (int idx = 0; idx < m_instances.GetLength(0); idx++)
            {
                goInstance = m_instances[idx];

                if (goInstance.m_spawnerPrefab == null)
                {
                    if (!string.IsNullOrEmpty(goInstance.m_spawnerPrefabFileName))
                    {
                        goInstance.m_spawnerPrefab = GaiaUtils.GetAsset(goInstance.m_spawnerPrefabFileName, typeof(UnityEngine.GameObject)) as GameObject;
                        if (goInstance.m_spawnerPrefab != null)
                        {
                            isModified = true;
                        }
                    }
                }

                //if (goInstance.m_mobilePrefab == null)
                //{
                //    if (!string.IsNullOrEmpty(goInstance.m_mobilePrefabFileName))
                //    {
                //        goInstance.m_mobilePrefab = GaiaUtils.GetAsset(goInstance.m_mobilePrefabFileName, typeof(UnityEngine.GameObject)) as GameObject;
                //        if (goInstance.m_mobilePrefab != null)
                //        {
                //            isModified = true;
                //        }
                //    }
                //}
            }
            #endif

            return(isModified);
        }