2026-04-22 모듈러 에셋 포함

This commit is contained in:
2026-04-22 10:25:40 +09:00
parent abaf994ebf
commit 7bdb7b7cd1
2466 changed files with 208897 additions and 4 deletions

View File

@@ -0,0 +1,44 @@
// Magica Cloth 2.
// Copyright (c) 2023 MagicaSoft.
// https://magicasoft.jp
using System.Collections.Generic;
using UnityEngine;
namespace MagicaCloth2
{
public class GameObjectContainer : MonoBehaviour
{
[SerializeField]
private List<GameObject> gameObjectList = new List<GameObject>();
private Dictionary<string, GameObject> gameObjectDict = new Dictionary<string, GameObject>();
protected void Awake()
{
// create dictionary.
foreach (var obj in gameObjectList)
{
if (obj)
{
gameObjectDict.Add(obj.name, obj);
}
}
}
public bool Contains(string objName)
{
return gameObjectDict.ContainsKey(objName);
}
public GameObject GetGameObject(string objName)
{
if (gameObjectDict.ContainsKey(objName))
{
return gameObjectDict[objName];
}
else
return null;
}
}
}