예제 #1
0
        public static GameObject Create(string text, Vector2 screenPosition, Color color)
        {
            GameObject prefab   = CasualEngine.Get <RavenhillEngine>().GetService <IResourceService>().GetCachedPrefab("screen_text");
            GameObject instance = Instantiate <GameObject>(prefab);

            instance.GetComponent <ScreenText>().Setup(new Data {
                text = text, color = color, screenPosition = screenPosition
            });
            return(instance);
        }
예제 #2
0
        public static DropObject Create(DropItem dropItem, Transform sourceTransform = null)
        {
            GameObject prefab = CasualEngine.Get <RavenhillEngine>()
                                .GetService <IResourceService>()
                                .Cast <RavenhillResourceService>()
                                .GetCachedPrefab("drop_object");
            GameObject    instance      = GameObject.Instantiate <GameObject>(prefab);
            CanvasService canvasService = CasualEngine.Get <RavenhillEngine>()
                                          .GetService <ICanvasSerive>()
                                          .Cast <CanvasService>();

            canvasService.AddToFirstGroup(instance.transform);
            DropObject dropObject = instance.GetComponent <DropObject>();

            dropObject.Setup(dropItem, sourceTransform);
            return(dropObject);
        }
예제 #3
0
 public static void SetListener(this Button button, UnityAction action)
 {
     button.SetListener(action, CasualEngine.Get <RavenhillEngine>().GetService <IAudioService>());
 }
예제 #4
0
 public static void SetListener(this Toggle toggle, UnityAction <bool> action)
 {
     toggle.SetListener(action, CasualEngine.Get <RavenhillEngine>().GetService <IAudioService>());
 }