public void Initialize(AbilityAction.Component component, AbilityData data)
    {
        action                = component;
        this.data             = data;
        this.data.Multiplier /= action.TotalTicks;

        startTime = Time.time;
    }
Esempio n. 2
0
    private float GetHeight(SerializedProperty element)
    {
        float height = reorderableList.GetHeight(element);

        AbilityAction.Component component = (AbilityAction.Component)element.objectReferenceValue;
        ActionEffectType        type      = component.EffectType;

        if (_extraHeight.ContainsKey(type))
        {
            height += GetExtraHeight(type);
        }

        return(height);
    }
Esempio n. 3
0
    private void DrawElement(Rect rect, SerializedProperty element, GUIContent label, bool selected, bool focused)
    {
        AbilityAction.Component component = (AbilityAction.Component)element.objectReferenceValue;
        ActionEffectType        type      = component.EffectType;

        rect.y += ElementSpacing;

        if (_extraInspector.ContainsKey(type))
        {
            _extraInspector[type](rect, element);

            rect.y      += GetExtraHeight(type);
            rect.height -= GetExtraHeight(type);
        }

        reorderableList.DrawElementInspector(rect, element, label, selected, focused);
    }
 public static void Apply(AbilityAction.Component component, AbilityData data)
 {
     data.Target.gameObject.AddComponent <ActionOverTime>().Initialize(component, data);
 }