protected override IEnumerator HandleBeforeEndPlay_Co() { m_UpdateSchedule.LogStatistics(); Destroy(m_UpdateSchedule); m_UpdateSchedule = null; m_SnakeSystem.Dispose(); m_SnakeSystem = null; m_FoodSystem.Dispose(); m_FoodSystem = null; m_Map.Dispose(); Destroy(m_Map); m_Map = null; yield return(null); m_PlayerController.Dispose(); }
protected override IEnumerator HandleAfterBeginPlay_Co() { m_GameMode = base.m_GameMode as slGameMode_Free; m_PlayerController = (Object.Instantiate(hwmSystem.GetInstance().GetAssetLoader().LoadAsset(hwmAssetLoader.AssetType.Game, "PlayerController")) as GameObject) .GetComponent <slPlayerController>(); m_PlayerController.Initialize(); m_Level = base.m_Level as slLevel; GameObject mapGameObject = new GameObject("Map"); m_Map = mapGameObject.AddComponent <slMap>(); m_Map.Initialize(GetLevel().MapSize); yield return(null); m_FoodSystem = new slFoodSystem(); m_FoodSystem.Initialize(GetLevel()); m_SnakeSystem = new slSnakeSystem(); m_SnakeSystem.Initialize(); m_UpdateSchedule = gameObject.AddComponent <slUpdateSchedule>(); }