using System.Collections.Generic; using UnityEngine; namespace UniVRM10.VRM10Viewer { class ObjectMap { Dictionary _map = new(); public IReadOnlyDictionary Objects => _map; public ObjectMap(GameObject root) { foreach (var x in root.GetComponentsInChildren()) { _map[x.name] = x.gameObject; } } public T Get(string name) where T : Component { return _map[name].GetComponent(); } } }