private static Layer2DComponent <asd.Layer2D> GetLayer2DComponent(this asd.Layer2D obj) { var component = (Layer2DComponent <asd.Layer2D>)obj.GetComponent(ComponentName); if (component == null) { component = new Layer2DComponent <asd.Layer2D>(ComponentName); component.Attach(obj); } return(component); }
/// <summary> /// コルーチンを管理するクラスを取得する。 /// </summary> public static CoroutineManager CoroutineManager(this asd.Layer2D layer) { var component = (CoroutineComponent)layer.GetComponent(CoroutineComponentName); if (component == null) { component = new CoroutineComponent(); layer.AddComponent(component, CoroutineComponentName); } return(component.Coroutine); }