예제 #1
0
        public bool CanDrop(Draggable draggable)
        {
            if (droppableDataTypes.Count == 0)
            {
                return(true);
            }

            foreach (var t in droppableDataTypes)
            {
                if (draggable.data.GetType() == Type.GetType(t))
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
        public void RemoveSpellComponentFromCraftZone(Draggable draggable)
        {
            if (draggable.data is SpellEffect)
            {
                draggable.AddDraggableToZone(effectZone);

                var effect = (SpellEffect)draggable.data;
                var index  = ((List <SpellEffectContainer>)spell.spellEffects).FindIndex(x => x.spellEffect.effectName == effect.effectName);
                if (index != -1)
                {
                    ((List <SpellEffectContainer>)spell.spellEffects).RemoveAt(index);
                }
            }
            else if (draggable.data is string)
            {
                draggable.AddDraggableToZone(targetZone);
            }

            Save();
        }
예제 #3
0
 internal void OnDragFailed(Draggable draggable)
 {
     onDragFailed.Invoke(draggable);
 }
예제 #4
0
 internal void OnDrop(Draggable draggable)
 {
     onDrop.Invoke(draggable);
 }