public virtual void Modify(GameObject source, GameObject target, GameObject offset = null) { if (source == null || target == null) { return; } offset = ApplyOffset ? offset : null; Premodified?.Invoke(eventData.Set(source, target, offset)); DoModify(source, target, offset); Modified?.Invoke(eventData.Set(source, target, offset)); }
/// <summary> /// Attempts to call each of the given <see cref="PropertyModifier"/> options to modify the target. /// </summary> /// <param name="source">The source to utilize in the modification.</param> /// <param name="target">The target to modify.</param> /// <param name="offset">The offset of the target against the source when modifying.</param> public virtual void Modify(GameObject source, GameObject target, GameObject offset = null) { if (!isActiveAndEnabled || !ValidateCache(source, target, offset)) { return; } Premodified?.Invoke(eventData.Set(source, target, offset)); positionModifier?.Modify(source, target, offset); rotationModifier?.Modify(source, target, offset); scaleModifier?.Modify(source, target, offset); Modified?.Invoke(eventData.Set(source, target, offset)); }
public virtual void Modify(GameObject source, GameObject target, GameObject offset = null) { if (!ValidateCache(source, target, offset)) { return; } Premodified?.Invoke(eventData.Set(source, target, offset)); if (ScaleModifier != null) { ScaleModifier.Modify(source, target, offset); } if (RotationModifier != null) { RotationModifier.Modify(source, target, offset); } if (PositionModifier != null) { PositionModifier.Modify(source, target, offset); } Modified?.Invoke(eventData.Set(source, target, offset)); }