Пример #1
0
 void TemplateDragBegin(AbilityUITemplate template, AbilityTemplate unit, PointerEventData pointerData)
 {
     if (OnTemplateDragBegin != null)
     {
         OnTemplateDragBegin(template, unit, pointerData);
     }
 }
 void SelectionChangeCallback(int index, AbilityTemplate target)
 {
     if (this.Index == index)
     {
         Set(Target);
     }
 }
Пример #3
0
 void TemplateClicked(AbilityUITemplate template, AbilityTemplate data)
 {
     if (OnClick != null)
     {
         OnClick(template, data);
     }
 }
        public virtual void Set(AbilityTemplate template)
        {
            this.Template = template;

            template.Icon.ApplyTo(icon);

            UpdateState();
        }
Пример #5
0
 void OnListElementClicked(AbilityUITemplate template, AbilityTemplate data)
 {
     if (Core.Player.Inventory.Contains(data))
     {
     }
     else
     {
         Core.UI.Buy.Show(data);
     }
 }
 void ListTemplateDrag(AbilityUITemplate template, AbilityTemplate unit, PointerEventData pointerData)
 {
     if (Instance == null)
     {
     }
     else
     {
         if (Instance.Template == template.Template)
         {
             SetTemplatePosition(pointerData);
         }
     }
 }
        public virtual void Add(AbilityTemplate template)
        {
            for (int i = 0; i < Count; i++)
            {
                if (this[i] == null)
                {
                    this[i] = template;
                    return;
                }
            }

            this[0] = template;
        }
Пример #8
0
        AbilitySelectionUITemplate CreateTemplate(AbilityTemplate unit, int index)
        {
            var instance = Instantiate(template, transform);

            instance.name = "Slot " + index.ToString();

            var script = instance.GetComponent <AbilitySelectionUITemplate>();

            script.Init(index);
            script.Set(unit);

            return(script);
        }
Пример #9
0
        AbilityUITemplate CreateTemplate(AbilityTemplate data)
        {
            var instance = Instantiate(template, ScrollRect.content);

            instance.name = data.name + " Template";

            var script = instance.GetComponent <AbilityUITemplate>();

            script.Init();
            script.Set(data);

            return(script);
        }
Пример #10
0
        //Static Utility
        public static ProponentAbility Create(ProponentAbilities abilities, AbilityTemplate template)
        {
            var instance = new GameObject(template.name);

            instance.transform.SetParent(abilities.transform);

            var script = instance.AddComponent <ProponentAbility>();

            script.Set(template);

            var cooldown = ProponentAbilityCooldown.Create(script);

            return(script);
        }
        public virtual void ClearAny(AbilityTemplate target)
        {
            if (target == null)
            {
                return;
            }

            for (int i = 0; i < Count; i++)
            {
                if (this[i] == target)
                {
                    this[i] = null;
                }
            }
        }
        public override void Set(AbilityTemplate data)
        {
            if (data == null)
            {
                base.Template = data;

                label.text = (Index + 1).ToString();
            }
            else
            {
                base.Set(data);
            }

            icon.gameObject.SetActive(data != null);
            label.gameObject.SetActive(data == null);

            GrayscaleController.On = data == null;
        }
        void ListTemplateDragEnd(AbilityUITemplate template, AbilityTemplate unit, PointerEventData pointerData)
        {
            if (Instance == null)
            {
            }
            else
            {
                Destroy(Instance.gameObject);

                Instance = null;

                Selection.Context.Apply();

                if (OnDragEnd != null)
                {
                    OnDragEnd();
                }
            }
        }
        void ListTemplateDragBegin(AbilityUITemplate UITemplate, AbilityTemplate template, PointerEventData pointerData)
        {
            if (Instance == null)
            {
                if (Player.Inventory.Contains(template.CatalogItem))
                {
                    Selection.Context.Start(UITemplate.Template);

                    Instance = CreateTemplate(UITemplate);

                    SetTemplatePosition(pointerData);

                    if (OnDragBegin != null)
                    {
                        OnDragBegin();
                    }
                }
            }
            else
            {
            }
        }
Пример #15
0
 public virtual void Set(AbilityTemplate reference)
 {
     this.Template = reference;
 }
 public virtual void Start(AbilityTemplate target)
 {
     Template = target;
 }
Пример #17
0
 public virtual void Configure(Proponent user, AbilityTemplate template)
 {
     this.User     = user;
     this.Template = template;
 }
        public override void Configure(Proponent user, AbilityTemplate template)
        {
            base.Configure(user, template);

            Elements = new List <Projectile>();
        }