/// <summary> /// appends a Tween at the end of the current flow /// </summary> public GoTweenChain append( AbstractGoTween tween ) { var item = new TweenFlowItem ( this.duration, tween ); append( item ); return this; }
/// <summary> /// inserts a Tween and sets it to start at the given startTime /// </summary> public GoTweenFlow insert( float startTime, AbstractGoTween tween ) { var item = new TweenFlowItem( startTime, tween ); insert( item ); return this; }
public void OpenDoors(AbstractGoTween tween) { Go.to(doorA.transform, 0.7f, new GoTweenConfig().position(new Vector3(0, 0, 0.28f),true).setEaseType(GoEaseType.QuadInOut).onComplete(OnRideComplete)); Go.to(doorB.transform, 0.7f, new GoTweenConfig().position(new Vector3(0, 0, -0.28f),true).setEaseType(GoEaseType.QuadInOut)); GetComponent<AudioSource>().PlayOneShot (doorOpen, doorOpenVolume); }
/// <summary> /// adds a Tween to the front of the flow /// </summary> public GoTweenChain prepend( AbstractGoTween tween ) { var item = new TweenFlowItem( 0, tween ); prepend( item ); return this; }
/// <summary> /// adds an AbstractTween (Tween, TweenChain or TweenFlow) to the current list of running Tweens /// </summary> public static void addTween( AbstractGoTween tween ) { // early out for invalid items if( !tween.isValid() ) return; // dont add the same tween twice if( _tweens.Contains( tween ) ) return; // check for dupes and handle them before adding the tween. we only need to check for Tweens if( duplicatePropertyRule != GoDuplicatePropertyRuleType.None && tween is GoTween ) { // if handleDuplicatePropertiesInTween returns true it indicates we should not add this tween if( handleDuplicatePropertiesInTween( tween as GoTween ) ) return; // if we became invalid after handling dupes dont add the tween if( !tween.isValid() ) return; } _tweens.Add( tween ); tween.play (); // enable ourself if we are not enabled if( !instance.enabled ) // purposely using the static instace property just once for initialization _instance.enabled = true; // if the Tween isn't paused and it is a "from" tween jump directly to the start position if( tween is GoTween && ((GoTween)tween).isFrom && tween.state != GoTweenState.Paused ) tween.update( 0 ); // should we start up the time scale independent update? if( !_instance._timeScaleIndependentUpdateIsRunning && tween.updateType == GoUpdateType.TimeScaleIndependentUpdate ) _instance.StartCoroutine( _instance.timeScaleIndependentUpdate() ); #if UNITY_EDITOR _instance.gameObject.name = string.Format( "GoKit ({0} tweens)", _tweens.Count ); #endif }
internal static AbstractGoTween updateTypeIs(this AbstractGoTween tween, GoUpdateType updateType) { tween.updateType = updateType; return(tween); }
private void OnSliderReachedEnd(AbstractGoTween _) { sliderTween = null; playerWonLastRound = false; }
internal static AbstractGoTween loops(this AbstractGoTween tween, int count) { tween.loopCount = count; return(tween); }
internal static AbstractGoTween loopsInfinitely(this AbstractGoTween tween) { tween.loopCount = -1; return(tween); }
void OnEnterComplete(AbstractGoTween tween) { textMesh.text = _text; }
/// <summary> /// removes the Tween returning true if it was removed or false if it was not found /// </summary> public static bool removeTween( AbstractGoTween tween ) { if( _tweens.Contains( tween ) ) { _tweens.Remove( tween ); #if UNITY_EDITOR if( _instance != null && _tweens != null ) _instance.gameObject.name = string.Format( "GoKit ({0} tweens)", _tweens.Count ); #endif if( _tweens.Count == 0 ) { // disable ourself if we have no more tweens instance.enabled = false; } return true; } return false; }
public void PlayHitAnimationHard(AbstractGoTween t) { hitAni.transform.rotation = Quaternion.Euler (0, 0, 0); hitAni.GetComponent<SpriteRenderer> ().enabled = true; hitAni.GetComponent<Animator> ().Play ("hitAnimationHard"); }
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); }
public void FinalKill(AbstractGoTween t = null) { if(!hasTypes.Contains(RLTypes.MONSTER) && !hasTypes.Contains(RLTypes.GOLD_PICKUP) && !hasTypes.Contains(RLTypes.HEALTH_PICKUP) && !hasTypes.Contains(RLTypes.ACTION_PICKUP) ) Camera.main.audio.PlayOneShot (AllTogether.instance().playerDeathAudio); Destroy (gameObject); }
public void PlayHit(AbstractGoTween t) { if(hasTypes.Contains(RLTypes.MONSTER)) Camera.main.audio.PlayOneShot (AllTogether.instance().playerHurtAudio); }
void HandleShowComplete(AbstractGoTween obj) { if (SignalShowComplete != null) SignalShowComplete (); }
void HandleHideComplete(AbstractGoTween obj) { this.RemoveFromContainer (); if (SignalHideComplete != null) SignalHideComplete (); }
private static void HandleExplodeSpriteComplete(AbstractGoTween tween) { FSprite explodeSprite = (tween as GoTween).target as FSprite; explodeSprite.RemoveFromContainer(); }
public void OnAnimationComplete(AbstractGoTween tween) { inputText.text = ""; inputText.color = new Color(0, 0, 0); }
private void OnStepComplete(AbstractGoTween tween) { isStepping = false; //clickToInstruction.renderer.enabled = true; }
/// <summary> /// Delete tween from the list /// </summary> public void Remove( AbstractGoTween tween ) { switch(tween.updateType) { case GoUpdateType.Update: update_tween.Remove (tween); break; case GoUpdateType.LateUpdate: late_update_tween.Remove(tween); break; case GoUpdateType.FixedUpdate: fixed_update_tween.Remove (tween); break; case GoUpdateType.TimeScaleIndependentUpdate: time_scale_tween.Remove (tween); break; default: throw new UnityException("update type doesn't make sense"); } combination_tween.Remove (tween); }
public void PlayHitAnimationHard(AbstractGoTween t) { hitAni.transform.rotation = Quaternion.Euler(0, 0, 0); hitAni.GetComponent <SpriteRenderer> ().enabled = true; hitAni.GetComponent <Animator> ().Play("hitAnimationHard"); }
void Start() { transform.localEulerAngles = new Vector3(0, 0, -15); transform.scaleFrom(0.5f, 0); rotateTween = transform.rotationTo(1, 15.0f).loopsInfinitely(GoLoopType.PingPong); }
public void startDay(AbstractGoTween agt = null) { orbitTween = Go.to(transform, m_maxDayDuration, new GoTweenConfig().rotation(new Vector3(0, 0, 360), true)); orbitTween.setOnCompleteHandler(startDay); }
private void OnOpenComplete(AbstractGoTween tween) { base.Cleanup (); }
private void DoorCleanup(AbstractGoTween tween) { base.Cleanup (); }
private void DoorCleanup(AbstractGoTween tween) { base.Cleanup(); }
float AnimateOpening() { AbstractGoTween tween = null; switch (gateName) { case GateName.Basique: tween = sprite.transform.localPositionTo(1, new Vector3(-70, 0, 0), true); break; case GateName.Bleue: tween = sprite.transform.localPositionTo(1, new Vector3(0, -120, 0), true); break; case GateName.Cassée: { GoTweenChain chain = new GoTweenChain(); chain.insert(0, sprite.transform.localPositionTo(0.5f, new Vector3(-2, -3, 0))); chain.insert(0.5f, sprite.transform.localPositionTo(1.0f, new Vector3(-60, 770, 0))); chain.Start(); tween = chain; } break; case GateName.Cloche: { GoTweenChain chain = new GoTweenChain(); chain.insert(0, sprite.transform.localPositionTo(0.5f, new Vector3(5, -5, 0))); chain.insert(0.5f, sprite.transform.localPositionTo(1.0f, new Vector3(-30, 55, 0))); chain.Start(); tween = chain; } break; case GateName.Colonne: { GoTweenChain chain = new GoTweenChain(); chain.insert(0, spriteA.transform.localPositionTo(1, new Vector3(-75, 10, 0))); chain.insert(0, spriteB.transform.localPositionTo(1, new Vector3(95, 10, 0))); chain.insert(1, spriteA.transform.localPositionTo(1, new Vector3(-75, 95, 0))); chain.insert(1, spriteB.transform.localPositionTo(1, new Vector3(105, 95, 0))); chain.Start(); tween = chain; } break; case GateName.Herbe: tween = sprite.transform.localPositionTo(1, new Vector3(0, -40, 0)); break; case GateName.Jaune: tween = sprite.transform.localPositionTo(1, new Vector3(0, -70, 0)); break; case GateName.Oeil: tween = sprite.transform.localPositionTo(1, new Vector3(0, 85, 0)); break; case GateName.Orange: tween = sprite.transform.localPositionTo(1, new Vector3(70, 0, 0)); break; case GateName.Orientale: { GoTweenChain chain = new GoTweenChain(); chain.insert(0, spriteA.transform.localPositionTo(1, new Vector3(0, 50, 0), true)); chain.insert(0, spriteB.transform.localPositionTo(1, new Vector3(0, -50, 0), true)); chain.Start(); tween = chain; } break; case GateName.Rouge: tween = sprite.transform.localPositionTo(1, new Vector3(0, -70, 0), true); break; case GateName.TriangleDroite: tween = sprite.transform.localPositionTo(1, new Vector3(65, 0, 0), true); break; case GateName.TriangleGauche: tween = sprite.transform.localPositionTo(1, new Vector3(-70, 0, 0), true); break; case GateName.Verte: tween = sprite.transform.localPositionTo(1, new Vector3(0, -65, 0), true); break; default: return(0); } return(tween.totalDuration); }
internal static AbstractGoTween loops(this AbstractGoTween tween, int count, GoLoopType loopType) { tween.loopCount = count; tween.loopType = loopType; return(tween); }
private void OnDialogueShowComplete(AbstractGoTween _) { Visible = true; transitioning = false; }
internal static AbstractGoTween loopsInfinitely(this AbstractGoTween tween, GoLoopType loopType) { tween.loopCount = -1; tween.loopType = loopType; return(tween); }
protected void HandleDone(AbstractGoTween tween) { FNode node=(FNode)(((GoTween)tween).target); //BumpUtil instance=null; //pendings.TryGetValue(node, out instance); pendings.Remove(node); }
public void RemoveFromContainer(AbstractGoTween tween) { FNode node = ((tween as GoTween).target) as FNode; if (node.container!=null) { node.RemoveFromContainer(); } FSpeechBubble bubble = node as FSpeechBubble; if (bubble!=null) { if (bubble.nodeFollower!=null) { bubble.nodeFollower.Stop(); bubble.nodeFollower=null; } } }
protected void HandleFlashDone(AbstractGoTween tween) { FSprite sprite=(FSprite)(((GoTween)tween).target); tweens.Remove(sprite); sprite.shader=FShader.Basic; sprite.color=Futile.white; sprite.alpha=0.9f; sprite.alpha=1.0f; //alpha dirty }
private void OnComplete(AbstractGoTween tween) { base.Cleanup(); }
public void RemoveFromContainer(AbstractGoTween tween) { //Debug.Log ("RemoveFromContainer tween="+tween); FNode node =(FNode)(((GoTween)tween).target); node.RemoveFromContainer(); }
/// <summary> /// check if the list contains the tween from parameter /// </summary> public bool Contains(AbstractGoTween tween) { return combination_tween.Contains(tween); }
void Start() { tween = sprite.transform.localPositionTo(jumpDuration, new Vector3(0, jumpHeight, 0), true) .eases(jumpEase) .loopsInfinitely(GoLoopType.PingPong); }
public TweenFlowItem(float startTime, AbstractGoTween tween) { this.tween = tween; this.startTime = startTime; this.duration = tween.totalDuration; }
public void DamageBossBig(AbstractGoTween tw) { bossIA.GetChar().Hit(currentAttackDamage, "hit2"); }
protected void HandleMidAnim(AbstractGoTween tween) { if (!_actionCalled) { _actionCalled=true; _action(_node); } }
private void SpawnComplete(AbstractGoTween tween) { smokeParticles.Play(); }
void OnIsHavingKeyChanged() { key.SetActive(Player.Instance.IsHavingKey); keyTween = key.transform.scaleTo(1, 0.5f, true).loopsInfinitely(GoLoopType.PingPong); }
protected void HandleEndAnim(AbstractGoTween tween) { Stop (); }
private void JumpGapCleanup(AbstractGoTween tween) { base.Cleanup (); }
protected void HandleSwitchElement(AbstractGoTween tween) { _sprite.element=_switchToElment; }
void OnExitComplete(AbstractGoTween tween) { speechBubble.enabled = false; }
//TWEEN EVENTS HANDLERS protected void OnPathFinish(AbstractGoTween obj) { MoveBug(); }
public TweenFlowItem( float startTime, AbstractGoTween tween ) { this.tween = tween; this.startTime = startTime; this.duration = tween.totalDuration; }
private void JumpGapCleanup(AbstractGoTween tween) { base.Cleanup(); }
protected virtual void HandleMoveToDone(AbstractGoTween tween) { _moveToAnim.destroy(); _moveToAnim=null; }
private static void HandleRemoveWhenDoneTweenComplete(AbstractGoTween tween) { ((tween as GoTween).target as FNode).RemoveFromContainer(); }
internal static AbstractGoTween delays(this AbstractGoTween tween, float delay) { tween.delay = delay; return(tween); }
private void OnJumpComplete(AbstractGoTween tween) { isJumping = false; base.Cleanup(); }