Inheritance: AbstractTweenProperty, IGenericProperty
示例#1
0
    /// <summary>
    /// generic float tween
    /// </summary>
    public TweenConfig floatProp( string propertyName, float endValue, bool isRelative = false )
    {
        var prop = new FloatTweenProperty( propertyName, endValue, isRelative );
        _tweenProperties.Add( prop );

        return this;
    }
    void OnGUI()
    {
        if (GUILayout.Button("Tween Custom Property (width -> localScale.x)"))
        {
            var prop = new FloatTweenProperty(this, "width", 8f);
            GoKitLite.instance.propertyTween(prop, 2f, 0, GoKitLiteEasing.Bounce.EaseOut);
        }


        if (GUILayout.Button("Relative Tween of Custom Property (height -> localScale.y)"))
        {
            var prop = new FloatTweenProperty(this, "height", 2f, true);
            GoKitLite.instance.propertyTween(prop, 1f, 0, GoKitLiteEasing.Bounce.EaseOut);
        }


        if (GUILayout.Button("Position Tween"))
        {
            var toTenTween    = new Vector3TweenProperty(cube, "position", new Vector3(10, 10, 10));
            var backHomeTween = new Vector3TweenProperty(cube, "position", Vector3.zero);

            GoKitLite.instance.propertyTween(toTenTween, 1f, 0, GoKitLiteEasing.Bounce.EaseOut)
            .next(1f, backHomeTween);
        }


        if (GUILayout.Button("Tween Main Texture Offset"))
        {
            var prop = new Vector2TweenProperty(cube.renderer.material, "mainTextureOffset", new Vector2(50, 50));
            GoKitLite.instance.propertyTween(prop, 60f, 0, GoKitLiteEasing.Linear.EaseNone);
        }
    }
示例#3
0
	void OnGUI()
	{
		if( GUILayout.Button( "Tween Custom Property (width -> localScale.x)" ) )
		{
			var prop = new FloatTweenProperty( this, "width", 8f );
			GoKitLite.instance.propertyTween( prop, 2f, 0, GoKitLiteEasing.Bounce.EaseOut );
		}
		
		
		if( GUILayout.Button( "Relative Tween of Custom Property (height -> localScale.y)" ) )
		{
			var prop = new FloatTweenProperty( this, "height", 2f, true );
			GoKitLite.instance.propertyTween( prop, 1f, 0, GoKitLiteEasing.Bounce.EaseOut );
		}
		

		if( GUILayout.Button( "Position Tween" ) )
		{
			var toTenTween = new Vector3TweenProperty( cube, "position", new Vector3( 10, 10, 10 ) );
			var backHomeTween = new Vector3TweenProperty( cube, "position", Vector3.zero );
			
			GoKitLite.instance.propertyTween( toTenTween, 1f, 0, GoKitLiteEasing.Bounce.EaseOut )
				.next( 1f, backHomeTween );
		}
		
		
		if( GUILayout.Button( "Tween Main Texture Offset" ) )
		{
			var prop = new Vector2TweenProperty( cube.renderer.material, "mainTextureOffset", new Vector2( 50, 50 ) );
			GoKitLite.instance.propertyTween( prop, 60f, 0, GoKitLiteEasing.Linear.EaseNone );
		}
	}
    public GoTweenConfig floatProp(string propertyName, float endValue, bool isRelative = false)
    {
        FloatTweenProperty item = new FloatTweenProperty(propertyName, endValue, isRelative);

        _tweenProperties.Add(item);
        return(this);
    }
示例#5
0
    /// <summary>
    /// generic float tween
    /// </summary>
    //public GoTweenConfig floatProp(string propertyName, float endValue, bool isRelative = false) {
    //    var prop = new FloatTweenProperty(propertyName, endValue, isRelative);
    //    _tweenProperties.Add(prop);

    //    return this;
    //}

    public GoTweenConfig floatProp(Func <float> getter, Action <float> setter, float endValue, bool isRelative = false)
    {
        var prop = new FloatTweenProperty(getter, setter, endValue, isRelative);

        _tweenProperties.Add(prop);

        return(this);
    }
示例#6
0
    /// <summary>
    /// shake generic float tween
    /// </summary>
    public GoTweenConfig shakeFloatProp( string propertyName, float endValue, bool isRelative = true, int frameMod = 1 )
    {
        var genericProp = new FloatTweenProperty( propertyName, endValue, isRelative );
        var prop = new AttenuatedShakeTweenProperty( genericProp, frameMod );
        _tweenProperties.Add( prop );

        return this;
    }