public void OnDestroy() { #if DEBUG if (playerInfo == null) { Plugin.log.Info("Destroying player controller!"); } else { Plugin.log.Info($"Destroying player controller! Name: {playerInfo.playerName}, ID: {playerInfo.playerId}"); } #endif destroyed = true; if (avatar != null) { Destroy(avatar.gameObject); } if (beatmapCallbackController != null && beatmapSpawnController != null && audioTimeController != null) { Destroy(beatmapCallbackController.gameObject, 2f); Destroy(audioTimeController.gameObject, 2f); Destroy(beatmapSpawnController.gameObject, 2f); beatmapSpawnController.PrepareForDestroy(); } }
public void SetBlocksState(bool active) { if (active && beatmapCallbackController == null && audioTimeController == null && beatmapSpawnController == null && _leftSaber == null && _rightSaber == null) { SpawnBeatmapControllers(); SpawnSabers(); } else if (!active && beatmapCallbackController != null && audioTimeController != null && beatmapSpawnController != null && _leftSaber != null && _rightSaber != null) { Destroy(beatmapCallbackController.gameObject); Destroy(audioTimeController.gameObject); Destroy(_leftSaber.gameObject); Destroy(_rightSaber.gameObject); beatmapSpawnController.PrepareForDestroy(); Destroy(beatmapSpawnController.gameObject, 1.4f); } }
public void SetBlocksState(bool active) { if (active && !playerInfo.updateInfo.playerLevelOptions.characteristicName.ToLower().Contains("degree") && beatmapCallbackController == null && audioTimeController == null && beatmapSpawnController == null && _leftSaber == null && _rightSaber == null) { SpawnBeatmapControllers(); SpawnSabers(); } else if (!active && beatmapCallbackController != null && audioTimeController != null && beatmapSpawnController != null && _leftSaber != null && _rightSaber != null) { Destroy(beatmapCallbackController.gameObject); Destroy(audioTimeController.gameObject); Destroy(_leftSaber.gameObject); Destroy(_rightSaber.gameObject); beatmapSpawnController.PrepareForDestroy(); Destroy(beatmapSpawnController.gameObject, 1.4f); } }