/// <summary>[コンストラクタ]</summary> public StoragePlayer(GameObject player, PlayerTerritoryIntermediary territoryIntermediary, PlayerMaualCollisionAdministrator maualCollisionAdministrator, GameObject[] followPoints) { playerInfo = new PlayerInfo(player, territoryIntermediary, maualCollisionAdministrator, followPoints); nextCalucrateFrameCount = 0; isCalucrateNextUpdate = false; }
/// <summary>[コンストラクタ]</summary> public PlayerInfo(GameObject gameObject, PlayerTerritoryIntermediary territoryIntermediary, PlayerMaualCollisionAdministrator maualCollisionAdministrator, GameObject[] followPoints) { this.gameObject = gameObject; this.territoryIntermediary = territoryIntermediary; this.maualCollisionAdministrator = maualCollisionAdministrator; this.followPoints = followPoints; instanceID = gameObject.GetInstanceID(); }
/// <summary> /// [AddPlayer] /// Playerを登録する /// 引数1: Player object /// 引数2: Player PlayerTerritoryIntermediary /// 引数3: Player PlayerMaualCollisionAdministrator /// 引数4: Player follow points /// 引数5: This main player?, default = true /// </summary> public void AddPlayer(GameObject player, PlayerTerritoryIntermediary territoryIntermediary, PlayerMaualCollisionAdministrator maualCollisionAdministrator, GameObject[] followPoints, bool isMainPlayer = true) { //debug only, invalid key対策 #if UNITY_EDITOR if (m_players.ContainsKey(player.GetInstanceID())) { Debug.LogError("Error!! PlayerAndTerritoryManager->AddPlayer\n ContainsKey(instanceID) == true"); return; } #endif StoragePlayer info = new StoragePlayer(player, territoryIntermediary, maualCollisionAdministrator, followPoints); m_players.Add(player.GetInstanceID(), info); if (isMainPlayer) { mainPlayer = info.playerInfo; } ServantManager.instance.RegisterPlayer(info.playerInfo.instanceID); }