コード例 #1
0
ファイル: SaveSystem.cs プロジェクト: S4D3H/ProjectJanitor
        /// <summary>
        /// Callback called by a MonoPersistentInitializer to load a MonoPersistent object
        /// </summary>
        /// <param name="uniqueName">the unique id of the MonoPersistent</param>
        /// <param name="obj">the related Monopersistent</param>
        public static void LoadMonoPersistent(string uniqueName, MonoPersistent obj)
        {
            DataContainer dCon;

            if (HasData(uniqueName, out dCon))
            {
                if (dCon.m_spawnable)
                {
                    obj.LoadData(dCon);
                }
                else
                {
                    Destroy(obj.gameObject);
                }
            }
        }
コード例 #2
0
ファイル: SaveSystem.cs プロジェクト: S4D3H/ProjectJanitor
        /// <summary>
        /// Callback called by a MonoPersistentInitializer to load a MonoPersistent object
        /// </summary>
        /// <param name="uniqueName">the unique id of the MonoPersistent</param>
        /// <param name="obj">the related Monopersistent</param>
        public static void LoadMonoPersistent(string uniqueName, MonoPersistent obj)
        {
            DataContainer dCon;

            if (HasData(uniqueName, out dCon))
            {
                if (dCon.m_spawnable)
                {
                    obj.LoadData(dCon);
                }
                else
                {
                    Destroy(obj.gameObject);
                }
            }
        }