Skip to content

Commit

Permalink
Merge pull request #83 from VirtualThief/recttransform-offset
Browse files Browse the repository at this point in the history
Fixed simultaneous tween of RectTransform offsetMin and offsetMax
  • Loading branch information
prime31 committed Jun 28, 2018
2 parents 8f1c874 + 8317054 commit 8dbfd9f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Assets/Plugins/GoKit/GoTweenConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public GoTweenConfig anchorMin( Vector2 endValue, bool isRelative = false )
/// </summary>
public GoTweenConfig offsetMax( Vector2 endValue, bool isRelative = false )
{
var prop = new OffsetTweenProperty( endValue, isRelative, true );
var prop = new OffsetMaxTweenProperty( endValue, isRelative );
_tweenProperties.Add( prop );

return this;
Expand All @@ -230,7 +230,7 @@ public GoTweenConfig offsetMax( Vector2 endValue, bool isRelative = false )
/// </summary>
public GoTweenConfig offsetMin( Vector2 endValue, bool isRelative = false )
{
var prop = new OffsetTweenProperty( endValue, isRelative );
var prop = new OffsetMinTweenProperty( endValue, isRelative );
_tweenProperties.Add( prop );

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections;


public sealed class OffsetTweenProperty : AbstractTweenProperty
public abstract class AbstractOffsetTweenProperty : AbstractTweenProperty
{
private bool _useMax;

Expand All @@ -13,7 +13,7 @@ public sealed class OffsetTweenProperty : AbstractTweenProperty
private Vector2 _endValue;
private Vector2 _diffValue;

public OffsetTweenProperty( Vector2 endValue, bool isRelative = false, bool useMax = false ) : base( isRelative )
public AbstractOffsetTweenProperty( Vector2 endValue, bool isRelative = false, bool useMax = false ) : base( isRelative )
{
_originalEndValue = endValue;
_useMax = useMax;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using UnityEngine;

public sealed class OffsetMaxTweenProperty : AbstractOffsetTweenProperty
{
public OffsetMaxTweenProperty( Vector2 endValue, bool isRelative = false ) : base( endValue, isRelative, useMax: true )
{
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using UnityEngine;

public sealed class OffsetMinTweenProperty : AbstractOffsetTweenProperty
{
public OffsetMinTweenProperty( Vector2 endValue, bool isRelative = false ) : base( endValue, isRelative, useMax: false )
{
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8dbfd9f

Please sign in to comment.