tsyu12345 / Rikkyo-MasterPJ

【立教 特別研究】修士論文、修了研究用リポジトリ
0 stars 0 forks source link

【横須賀MAP】避難者のタワー識別処理において、UUIDによる除外処理が正常に働かない #49

Closed tsyu12345 closed 3 months ago

tsyu12345 commented 3 months ago

起動時にエラー

NullReferenceException: Object reference not set to an instance of an object
Evacuee.SearchTowers (System.Collections.Generic.List`1[T] excludeTowerUUIDs) (at Assets/Scripts/Evacuee.cs:149)
Evacuee.Update () (at Assets/Scripts/Evacuee.cs:55)

36

tsyu12345 commented 3 months ago

Master-Simulator\Assets\Scripts\PLATEAUEnvManager.cs

private void RegisterTowers() {
        Towers.Clear();
        var towers = GameObject.FindGameObjectsWithTag(Tags.Tower);
        foreach(var towerObj in towers) {
            Tower tower = towerObj.GetComponent<Tower>(); //なぜかNullになっている
            tower.uuid = Guid.NewGuid().ToString();
            Towers.Add(towerObj);
        }
    }
tsyu12345 commented 3 months ago

単なるTowerコンポーネントの付け忘れだった