Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public static void SetListener(this Button button, UnityAction action)
 {
     button.SetListener(action, CasualEngine.Get <RavenhillEngine>().GetService <IAudioService>());
 }
Esempio n. 4
0
 public static void SetListener(this Toggle toggle, UnityAction <bool> action)
 {
     toggle.SetListener(action, CasualEngine.Get <RavenhillEngine>().GetService <IAudioService>());
 }