setEaseType() public method

sets the ease type for the Tween
public setEaseType ( GoEaseType easeType ) : GoTweenConfig
easeType GoEaseType
return GoTweenConfig
コード例 #1
0
    void Awake()
    {
        if (affectedTransform == null)
        {
            Debug.LogError("affectedTransform must be filled in.");
        }

        // Grab all platforms
        affectedPlatforms = affectedTransform.GetComponentsInChildren <SetupTextPlatform>();

        // Setup animation configuration
        itemAnimationConfiguration.setIterations((loopForever ? -1 : 1), loopType);
        itemAnimationConfiguration.setEaseType(animationType);

        // Setup scale and rotation
        itemAnimationConfiguration.localRotation(Quaternion.identity);
        itemAnimationConfiguration.scale(Vector3.one);
        itemAnimationConfiguration.localPosition(Vector3.zero);

        // Disable all parenting scripts
        if (disableParentingAutomatically == true)
        {
            ParentToRotateEverything[] allParentScripts = affectedTransform.GetComponentsInChildren <ParentToRotateEverything>();
            foreach (ParentToRotateEverything parentScript in allParentScripts)
            {
                parentScript.enabled = false;
            }
        }
    }
コード例 #2
0
ファイル: GoKitHelper.cs プロジェクト: waikayk/RitualCombat
	public static GoTween MakeTween(
		Transform TheTransform, 
		Vector3 Position, 
		Quaternion Rotation, 
		float MoveTime = 0.5f, 
		bool IsLocal = false, 
		GoEaseType Ease = GoEaseType.Linear,
		VoidDelegate OnCompleteFunction = null
		)
	{
		GoTweenConfig Config = new GoTweenConfig();
		Config.addTweenProperty(new PositionTweenProperty(Position, false, IsLocal));
		//Config.addTweenProperty(new EulerAnglesTweenProperty(Rotation, false, IsLocal));
		Config.addTweenProperty(new RotationQuaternionTweenProperty(Rotation, false, IsLocal));
		Config.setEaseType(Ease);
		if(OnCompleteFunction != null){
			Config.onComplete(c => {
				OnCompleteFunction();
			});
		}
		GoTween NewTween = new GoTween(TheTransform, MoveTime, Config);
		Go.addTween(NewTween);
		
		return NewTween;
	}
コード例 #3
0
        public override void Hide(BaseWindow t, Action <AbstractGoTween> onComplete)
        {
            t.CachedTransform.localPosition = _hideStartVector3;

            _hideConfig.onCompleteHandler = onComplete;

            Go.to(t.CachedTransform, AlphaOutDuration, _hideConfig.setEaseType(Type));
            Go.to(t, HideTransitionTime, _hidePanelConfig);
        }
コード例 #4
0
    public override void Start()
    {
        base.Start();
        currentState = startingState;
        pickupLabel  = GetComponent <TextMesh>();

        // Setup animation configuration
        itemAnimationConfiguration.setIterations(1, GoLoopType.RestartFromBeginning);
        itemAnimationConfiguration.setEaseType(animationType);
    }
コード例 #5
0
        public override void Show(BaseWindow t, Action <AbstractGoTween> onComplete)
        {
            t.CachedTransform.localPosition = _showStartVector3;
            t.CachedTransform.localScale    = Vector3.one;

            _showConfig.onCompleteHandler = onComplete;

            Go.to(t.CachedTransform, AlphaInDuration, _showConfig.setEaseType(Type));
            Go.to(t, ShowTransitionTime, _showPanelConfig);
        }
コード例 #6
0
    public override void DoClickToAct()
    {
        var doorMove  = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( 0, 0, 0.25f), new Vector3( 0, 0, 0.5f)};
        var path = new GoSpline( doorMove );
        path.closePath();

        GoTweenConfig doorConfig = new GoTweenConfig().positionPath(path,true).onComplete(DoorCleanup);

        doorConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to( transform, openTime, doorConfig);
    }
コード例 #7
0
    public void SpinElevator()
    {
        RotationTweenProperty rotationProperty = new RotationTweenProperty(new Vector3(0, -180, 0), true, true);

        GoTweenConfig rotConfig = new GoTweenConfig().addTweenProperty(rotationProperty);

        rotConfig.setEaseType(GoEaseType.QuadInOut);

        //Go.to( player.transform, rideTime, rotConfig);
        Go.to(transform.parent.gameObject.transform, spinTime, rotConfig);
    }
コード例 #8
0
    private void OnTriggerExit(Collider other)
    {
        var doorMove  = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( 0, 0, -0.25f), new Vector3( 0, 0, -0.5f)};
        var path = new GoSpline( doorMove );
        path.closePath();

        GoTweenConfig doorConfig = new GoTweenConfig().positionPath(path,true).onComplete(DoorCleanup);

        doorConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to( transform, openTime, doorConfig);
    }
コード例 #9
0
    public void SpinElevator()
    {
        RotationTweenProperty rotationProperty = new RotationTweenProperty (new Vector3 (0, -180, 0), true, true);

        GoTweenConfig rotConfig = new GoTweenConfig ().addTweenProperty (rotationProperty);

        rotConfig.setEaseType(GoEaseType.QuadInOut);

        //Go.to( player.transform, rideTime, rotConfig);
        Go.to( transform.parent.gameObject.transform, spinTime, rotConfig);
    }
コード例 #10
0
    public void Push()
    {
        var pushPoints = new Vector3[] { new Vector3(0, 0, 0), buttonPushVector };
        var path       = new GoSpline(pushPoints);

        path.closePath();

        GoTweenConfig pushConfig = new GoTweenConfig().positionPath(path, true);

        pushConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to(transform, timeForButtonPush, pushConfig);
    }
コード例 #11
0
    public override void DoClickToAct()
    {
        var doorMove = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 0, -0.25f), new Vector3(0, 0, -0.5f) };
        var path     = new GoSpline(doorMove);

        path.closePath();

        GoTweenConfig doorConfig = new GoTweenConfig().positionPath(path, true).onComplete(DoorCleanup);

        doorConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to(transform, openTime, doorConfig);
    }
コード例 #12
0
    private void OnTriggerExit(Collider other)
    {
        var doorMove = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 0, 0.25f), new Vector3(0, 0, 0.5f) };
        var path     = new GoSpline(doorMove);

        path.closePath();

        GoTweenConfig doorConfig = new GoTweenConfig().positionPath(path, true).onComplete(DoorCleanup);

        doorConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to(transform, openTime, doorConfig);
    }
コード例 #13
0
    public override void DoClickToAct()
    {
        //ScaleTweenProperty DoorScale = new blabla
        buttonPush.Push ();
        var elevatorPath = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( 0, 2.4f, 0 )};
        var path = new GoSpline( elevatorPath );
        //path.closePath();

        GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path,true).onComplete(OpenDoors);

        stepConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to( transform.parent.gameObject.transform, callTime, stepConfig);
    }
コード例 #14
0
    public override void DoClickToAct()
    {
        //ScaleTweenProperty DoorScale = new blabla
        buttonPush.Push();
        var elevatorPath = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 2.4f, 0) };
        var path         = new GoSpline(elevatorPath);
        //path.closePath();

        GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path, true).onComplete(OpenDoors);

        stepConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to(transform.parent.gameObject.transform, callTime, stepConfig);
    }
コード例 #15
0
    public override void DoClickToAct()
    {
        var jumpPath  = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( -jumpLength/2, jumpHeight, 0), new Vector3( -jumpLength, 0, 0 )};
        var path = new GoSpline( jumpPath );
        path.closePath();

        //GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path,true).onComplete(OnJumpComplete);
        GoTweenConfig jumpConfig = new GoTweenConfig().positionPath(path,true).onComplete(JumpGapCleanup);

        jumpConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to( player.transform, jumpGapTime, jumpConfig);
        Invoke ("PlayLandAudio", timeTillPlayLand);
    }
コード例 #16
0
    public override void DoClickToAct()
    {
        var jumpPath = new Vector3[] { new Vector3(0, 0, 0), new Vector3(-jumpLength / 2, jumpHeight, 0), new Vector3(-jumpLength, 0, 0) };
        var path     = new GoSpline(jumpPath);

        path.closePath();

        //GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path,true).onComplete(OnJumpComplete);
        GoTweenConfig jumpConfig = new GoTweenConfig().positionPath(path, true).onComplete(JumpGapCleanup);

        jumpConfig.setEaseType(GoEaseType.QuadInOut);
        Go.to(player.transform, jumpGapTime, jumpConfig);
        Invoke("PlayLandAudio", timeTillPlayLand);
    }
コード例 #17
0
 static public int setEaseType(IntPtr l)
 {
     try {
         GoTweenConfig self = (GoTweenConfig)checkSelf(l);
         GoEaseType    a1;
         checkEnum(l, 2, out a1);
         var ret = self.setEaseType(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #18
0
ファイル: ClickToJump.cs プロジェクト: Niklaren/Click-To-Play
    public override void DoClickToAct()
    {
        if(isJumping == false)
        {
                //Bob
                isJumping = true;
                //clickToInstruction.renderer.enabled = false;
                var headPopPoints = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0), new Vector3( 0, 0, 0 )};
                var path = new GoSpline( headPopPoints );
                path.closePath();

                GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path,true).onComplete(OnJumpComplete);

                stepConfig.setEaseType(GoEaseType.QuadOut);
                Go.to( player.transform, jumpTime, stepConfig);
        }
    }
コード例 #19
0
ファイル: ClickToJump.cs プロジェクト: Niklaren/Click-To-Play
    public override void DoClickToAct()
    {
        if (isJumping == false)
        {
            //Bob
            isJumping = true;
            //clickToInstruction.renderer.enabled = false;
            var headPopPoints = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 0) };
            var path          = new GoSpline(headPopPoints);
            path.closePath();

            GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path, true).onComplete(OnJumpComplete);

            stepConfig.setEaseType(GoEaseType.QuadOut);
            Go.to(player.transform, jumpTime, stepConfig);
        }
    }
コード例 #20
0
ファイル: Player.cs プロジェクト: nialltl/Muddledash
    void Unbop()
    {
        if (canControl) return;

        StartCoroutine(InvincibilityTimeout());

        canControl = true;

        // Tween cleanup, remove stun halo
        Go.killAllTweensWithTarget(stunHalo);
        haloUndoConfig.clearEvents();
        haloUndoConfig.onComplete(c => {
            stunHalo.gameObject.SetActive(false);
        });
        Go.to(stunHalo, 0.5f, haloUndoConfig);

        if (tired) {
            face.SetFace(Face.FaceType.Tired);
        } else {
            // return to default face if we're not in 'surprised' mode
            if (face.ActiveFace != Face.FaceType.Surprised) {
                var reaction = Random.Range(0f, 1f) < 0.5f ?
                    Face.FaceType.Default :
                    Face.FaceType.Frowning;

                face.SetFace(reaction);
            }
        }

        isInked = false;
        head.DisableInkSplat();

        bopTweenConfig.clearEvents();
        bopTweenConfig.clearProperties();
        bopTweenConfig.setEaseType(GoEaseType.ElasticOut);

        if (elasticRoutine != null) StopCoroutine(elasticRoutine);
        elasticRoutine = StartCoroutine(ElasticStandUp());

        // Jump up from bopped position
        if (surface == Surface.Ground) {
            cachedVelocity = rbody.velocity;
            cachedVelocity.y = jumpSpeed / 1.5f;
            rbody.velocity = cachedVelocity;
        }
    }
コード例 #21
0
ファイル: Main.cs プロジェクト: tanis2000/Futile
    public void FadeToPage(PageType pageType, Color color, float duration, bool force)
    {
        if(_currentPageType == pageType)  if (!force) return; //we're already on the same page, so don't bother doing anything

        _transitionPageType=pageType;

        FSprite fadeSprite=new FSprite("Futile_White");
        fadeSprite.scaleX=Futile.screen.width/fadeSprite.textureRect.width;
        fadeSprite.scaleY=Futile.screen.height/fadeSprite.textureRect.height;
        fadeSprite.color=color;
        fadeSprite.alpha=0f;
        _stage.AddChild(fadeSprite);

        GoTweenConfig config0=new GoTweenConfig().floatProp("alpha",1f).onComplete(MiddleTransition);

        config0.setEaseType(GoEaseType.Linear);
        //config0.setEaseType(EaseType.ExpoIn);
        //config0.setEaseType(EaseType.ElasticIn);
        Go.to (fadeSprite, duration*0.5f, config0);
    }
コード例 #22
0
    public override void DoClickToAct()
    {
        clickToStep.enabled = false;
        Vector3 nextPosition = new Vector3(nextPlatform.transform.position.x, nextPlatform.transform.position.y + jumpHitVerticalOffset, nextPlatform.transform.position.z);

        Vector3 jumpCenter;
        jumpCenter = player.transform.position + nextPlatform.transform.position;
        jumpCenter /= 2;
        jumpCenter.y += jumpHeight * Vector3.Distance(player.transform.position, nextPosition);
        //jumpCenter;
        Vector3[] jumpVecs = new Vector3[]{player.transform.position, jumpCenter ,new Vector3(nextPlatform.transform.position.x, nextPlatform.transform.position.y + jumpHitVerticalOffset, nextPlatform.transform.position.z)};
        GoSpline path = new GoSpline (jumpVecs);
        //path.closePath ();

        GoTweenConfig jumpConfig = new GoTweenConfig().positionPath(path,false).onComplete(JumpCleanup);
        jumpConfig.setEaseType (GoEaseType.SineInOut);

        Go.to(player.transform, jumpTime, jumpConfig);

        //Invoke ("PlayLandAudio", jumpTime - 0.2f);
    }
コード例 #23
0
    public override void DoClickToAct()
    {
        clickToStep.enabled = false;
        Vector3 nextPosition = new Vector3(nextPlatform.transform.position.x, nextPlatform.transform.position.y + jumpHitVerticalOffset, nextPlatform.transform.position.z);

        Vector3 jumpCenter;

        jumpCenter    = player.transform.position + nextPlatform.transform.position;
        jumpCenter   /= 2;
        jumpCenter.y += jumpHeight * Vector3.Distance(player.transform.position, nextPosition);
        //jumpCenter;
        Vector3[] jumpVecs = new Vector3[] { player.transform.position, jumpCenter, new Vector3(nextPlatform.transform.position.x, nextPlatform.transform.position.y + jumpHitVerticalOffset, nextPlatform.transform.position.z) };
        GoSpline  path     = new GoSpline(jumpVecs);
        //path.closePath ();

        GoTweenConfig jumpConfig = new GoTweenConfig().positionPath(path, false).onComplete(JumpCleanup);

        jumpConfig.setEaseType(GoEaseType.SineInOut);

        Go.to(player.transform, jumpTime, jumpConfig);

        //Invoke ("PlayLandAudio", jumpTime - 0.2f);
    }
コード例 #24
0
ファイル: ClickToStep.cs プロジェクト: Niklaren/Click-To-Play
    private void DoClickToStep()
    {
        if (isStepping == false)
        {
            if (Input.GetMouseButtonDown(0))
            {
                float xdistance = -(stepLength * Mathf.Cos(horizontalAngle));
                float zdistance = (stepLength * Mathf.Sin(horizontalAngle));

                //Bob
                isStepping = true;
                clickToInstruction.GetComponent <Renderer>().enabled = false;
                var headPopPoints = new Vector3[] { new Vector3(0, 0, 0), new Vector3(xdistance / 2, stepBobHeight, zdistance / 2), new Vector3(xdistance, heightChange, zdistance) };
                var path          = new GoSpline(headPopPoints);
                path.closePath();

                GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path, true).onComplete(OnStepComplete);

                stepConfig.setEaseType(GoEaseType.QuadInOut);
                Go.to(transform, stepTime, stepConfig);
            }
        }
    }
コード例 #25
0
ファイル: ClickToStep.cs プロジェクト: Niklaren/Click-To-Play
    private void DoClickToStep()
    {
        if(isStepping == false)
        {
            if(Input.GetMouseButtonDown(0))
            {
                float xdistance = -(stepLength*Mathf.Cos(horizontalAngle));
                float zdistance = (stepLength*Mathf.Sin(horizontalAngle));

                //Bob
                isStepping = true;
                clickToInstruction.GetComponent<Renderer>().enabled = false;
                var headPopPoints = new Vector3[] { new Vector3( 0, 0, 0 ), new Vector3( xdistance/2, stepBobHeight, zdistance/2 ), new Vector3( xdistance, heightChange, zdistance )};
                var path = new GoSpline( headPopPoints );
                path.closePath();

                GoTweenConfig stepConfig = new GoTweenConfig().positionPath(path,true).onComplete(OnStepComplete);

                stepConfig.setEaseType(GoEaseType.QuadInOut);
                Go.to( transform, stepTime, stepConfig);

            }
        }
    }
コード例 #26
0
ファイル: FxUtils.cs プロジェクト: tanis2000/Futile
    public void go(FNode node, float period, float scaleX, float scaleY)
    {
        Cancel (node);

        chain = new GoTweenChain(new GoTweenCollectionConfig().setIterations(-1,GoLoopType.PingPong));
        chain.autoRemoveOnComplete=true;
        //chain.setIterations( -1, LoopType.PingPong );
        GoTweenConfig config0=new GoTweenConfig();

        if (scaleX!=node.scaleX) config0.floatProp( "scaleX", scaleX );
        if (scaleY!=node.scaleY) config0.floatProp( "scaleY", scaleY );

        config0.setEaseType(GoEaseType.SineInOut);

        chain.append( new GoTween( node, period, config0 ) );
        chain.play();

        memoScaleX=node.scaleX;
        memoScaleY=node.scaleY;
        pendings.Add(node,this);
    }
コード例 #27
0
ファイル: Main.cs プロジェクト: tanis2000/Futile
    protected void MiddleTransition(AbstractGoTween tween)
    {
        GoToPage(_transitionPageType,true);
        _transitionPageType = PageType.None;

        FSprite fadeSprite=(FSprite)(((GoTween)tween).target);
        fadeSprite.RemoveFromContainer();
        _stage.AddChild(fadeSprite);

        GoTweenConfig config0=new GoTweenConfig().floatProp("alpha",0f).onComplete(FxHelper.Instance.RemoveFromContainer);
        config0.setEaseType(GoEaseType.Linear);
        //config0.setEaseType(EaseType.ExpoOut);
        //config0.setEaseType(EaseType.ElasticIn);
        Go.to(fadeSprite, tween.duration, config0);
    }
コード例 #28
0
ファイル: FxUtils.cs プロジェクト: tanis2000/Futile
    public void go(FNode node, float period, float ampX, float ampY)
    {
        Cancel (node);

        chain = new GoTweenChain(new GoTweenCollectionConfig().setIterations(-1,GoLoopType.PingPong));
        chain.autoRemoveOnComplete=true;
        //chain.setIterations( -1, LoopType.PingPong );
        GoTweenConfig config0=new GoTweenConfig();

        if (ampX!=0) config0.floatProp( "x", node.x+ampX );
        if (ampY!=0) config0.floatProp( "y", node.y+ampY );

        config0.setEaseType(GoEaseType.SineInOut);

        chain.append( new GoTween( node, period, config0 ) );
        chain.play();

        pendings.Add(node,this);
    }
コード例 #29
0
ファイル: FxUtils.cs プロジェクト: tanis2000/Futile
    public void go(FSprite node, float period, Color toColor  )
    {
        Cancel (node);

        //Debug.Log ("OscilColorUtil node="+node);
        chain = new GoTweenChain(new GoTweenCollectionConfig().setIterations(-1,GoLoopType.PingPong));
        chain.autoRemoveOnComplete=true;
        //chain.setIterations( -1, LoopType.PingPong );
        GoTweenConfig config0=new GoTweenConfig();
        config0.colorProp("color",toColor);
        config0.setEaseType(GoEaseType.SineInOut);

        chain.append( new GoTween( node, period, config0 ) );
        chain.play();

        memoColor=node.color;
        pendings.Add(node,this);
    }
コード例 #30
0
ファイル: FxUtils.cs プロジェクト: tanis2000/Futile
    public void go(FSprite node, float period, float toAlpha  )
    {
        Cancel (node);

        chain = new GoTweenChain(new GoTweenCollectionConfig().setIterations(-1,GoLoopType.PingPong));
        chain.autoRemoveOnComplete=true;
        //chain.setIterations( -1, LoopType.PingPong );
        GoTweenConfig config0=new GoTweenConfig();
        config0.floatProp("alpha",toAlpha);
        config0.setEaseType(GoEaseType.SineInOut);

        chain.append( new GoTween( node, period, config0 ) );
        chain.play();

        memoAlpha=node.alpha;
        pendings.Add(node,this);
    }
コード例 #31
0
ファイル: FxUtils.cs プロジェクト: tanis2000/Futile
 public void go(FSprite sprite,Color color)
 {
     Cancel (sprite);
     sprite.shader=FShader.AdditiveColor;
     sprite.color=color;
     GoTweenConfig config0=new GoTweenConfig().colorProp("color",new Color(0f,0f,0f)).onComplete(HandleFlashDone);
     config0.setEaseType(GoEaseType.ExpoOut);
     tweens.Add(sprite,Go.to (sprite, 0.5f, config0));
 }
コード例 #32
0
ファイル: GoKitHelper.cs プロジェクト: waikayk/RitualCombat
	public static GoTween MakeTweenScale(
		Transform TheTransform,
		Vector3 Scale,
		float MoveTime,
		bool IsLocal = false,
		GoEaseType Ease = GoEaseType.Linear,
		VoidDelegate OnCompleteFunction = null
		)
	{
		GoTweenConfig Config = new GoTweenConfig();
		Config.addTweenProperty(new ScaleTweenProperty(Scale, false));
		Config.setEaseType(Ease);
		if(OnCompleteFunction != null){
			Config.onComplete(c => {
				OnCompleteFunction();
			});
		}
		
		GoTween NewTween = new GoTween(TheTransform, MoveTime, Config);
		Go.addTween(NewTween);
		
		return NewTween;
	}