예제 #1
0
        private static void Remove(SimbaComponent component)
        {
            var type = component.GetType();

            if (TypeToInstance.ContainsKey(type))
            {
                TypeToInstance.Remove(type);
            }
            else
            {
                throw new ApplicationException($"{component} was not cached");
            }
        }
예제 #2
0
        private static void Add(SimbaComponent component)
        {
            var type = component.GetType();

            if (TypeToInstance.ContainsKey(type))
            {
                Debug.LogError($"{type} was already instantiated somewhere");
            }
            else
            {
                TypeToInstance.Add(type, component);
            }
        }