コード例 #1
0
ファイル: LevelGameplay.cs プロジェクト: lsmolic/hangoutsrc
        public void Dispose()
        {
            if (mFacebookFeedUpdate != null)
            {
                mFacebookFeedUpdate.Exit();
            }

            if (mSpawnWaves != null)
            {
                mSpawnWaves.Exit();
            }

            mSpawnModels.Dispose();

            List <KeyValuePair <GameObject, FashionModel> > activeModelList = new List <KeyValuePair <GameObject, FashionModel> >(mActiveModels);

            foreach (KeyValuePair <GameObject, FashionModel> activeModel in activeModelList)
            {
                if (activeModel.Value == null)
                {
                    throw new Exception("There's a null activeModel.Value in the level");
                }
                activeModel.Value.SetToInactive();
            }
            mActiveModels.Clear();
        }
コード例 #2
0
ファイル: FashionLevel.cs プロジェクト: lsmolic/hangoutsrc
        public override void OnRemove()
        {
            base.OnRemove();

            foreach (FashionGameStation station in mStations.Values)
            {
                if (station == null)
                {
                    throw new Exception("There's a null station in the level");
                }
                station.Dispose();
            }
            mStations.Clear();

            UnityEngine.GameObject.Destroy(mLevelRoot);

            if (mLevelAsset != null)
            {
                mLevelAsset.Dispose();
            }

            mLevelGui.Dispose();
            mLevelGameplay.Dispose();
            mLevelTasks.Dispose();
        }
コード例 #3
0
        public void TaskCollectionDisposeVerification()
        {
            TaskCollection testCollection = new TaskCollection();

            testCollection.Add(new MockTask());
            testCollection.Add(new MockTask());
            testCollection.Add(new MockTask());
            testCollection.Add(new MockTask());
            testCollection.Add(new MockTask());

            Assert.AreEqual(5, testCollection.Count);
            testCollection.Dispose();

            Assert.AreEqual(0, testCollection.Count);
        }
コード例 #4
0
        public override void OnRemove()
        {
            base.OnRemove();

            mActiveTasks.Dispose();

            mHairStationWorkers.Dispose();
            mMakeupStationWorkers.Dispose();
            mSewingStationWorkers.Dispose();
            mFashionModels.Dispose();

            foreach (Asset asset in mDefaultWorkerClothes)
            {
                asset.Dispose();
            }
            foreach (Asset asset in mDefaultWorkerClothes)
            {
                asset.Dispose();
            }
        }