-
-
Save todorok1/772340e3a0dde51753a6716a6ee896a2 to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第78回 マップ機能を管理するクラス
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// IDに対応するマップの名前を取得します。 | |
| /// </summary> | |
| public string GetMapNameFromId(int mapId) | |
| { | |
| string mapName = string.Empty; | |
| var mapPrefab = GetMapPrefabById(mapId); | |
| if (mapPrefab == null) | |
| { | |
| SimpleLogger.Instance.LogWarning($"指定したIDのマップPrefabが見つかりませんでした。 ID: {mapId}"); | |
| return mapName; | |
| } | |
| var controller = mapPrefab.GetComponent<MapController>(); | |
| if (controller == null) | |
| { | |
| SimpleLogger.Instance.LogWarning($"指定したIDのPrefabでMapControllerが見つかりませんでした。 ID: {mapId}"); | |
| return mapName; | |
| } | |
| return controller.MapName; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment