public void LookToAnimation(float time, iTween.EaseType eType = iTween.EaseType.linear, DelegateType.MovePathCallback onComplete = null) { // Hashtable args = new Hashtable(); // args.Add("looktarget", targetPos); // args.Add("time", time); // args.Add("easetype", eType); // args.Add("oncomplete", "LookToAnimationComplete"); // args.Add("oncompletetarget", gameObject); // iTween.LookTo(gameObject, args); Hashtable args = new Hashtable(); args.Add("from", 0f); args.Add("to", 1f); args.Add("time", time); args.Add("easetype", eType); args.Add("onupdate", "LookToAnimationUpdate"); args.Add("onupdatetarget", gameObject); args.Add("oncomplete", "LookToAnimationComplete"); args.Add("oncompletetarget", gameObject); args.Add("ignoretimescale", false); iTween.ValueTo(gameObject, args); beginRotation = gameObject.transform.localRotation; finalRotation = Quaternion.LookRotation(posLookAt1 - posEnd); onLookToComplete = onComplete; isDoingLookTo = true; }
// The PopIn function. Scales an object up from 0 to its normal size. Good for popping an object into the world. public static void PopIn(GameObject obj, float time = 1.5f, float delay = 0, iTween.EaseType easeType = iTween.EaseType.easeOutElastic) { if (iTween.Count(obj, "scale") < 1) { iTween.ScaleFrom(obj, iTween.Hash("scale", Vector3.zero, "time", time, "delay", delay, "easetype", easeType)); } }
protected void MoveTo(GameObject go, Vector3 vP, float time, iTween.EaseType type = iTween.EaseType.linear) { iTween.MoveTo(go, new Hashtable { { "isLocal", true }, { "x", vP.x }, { "y", vP.y }, { "time", time }, { "easetype", type } }); }
/// <summary> /// Tweens a value from "From" to "To". /// </summary> /// <param name="data">The tween data.</param> /// <returns>The started tween reference.</returns> public Tween StartValueTo(ValueToAnimation data) { string id = tweenIdentifier.ToString(); iTween.EaseType easeType = tweenTypeDictionary[data.EaseType]; Hashtable args = new Hashtable(); args["name"] = id; args["onupdatetarget"] = data.GameObject; args["onupdate"] = data.OnUpdate; args["from"] = 0f; args["to"] = 1f; args["time"] = data.Duration; args["delay"] = data.Delay; args["easetype"] = easeType; args["oncompletetarget"] = data.GameObject; args["oncomplete"] = data.OnComplete; if (data.PingPongLoop) { args["looptype"] = iTween.LoopType.pingPong; } iTween.ValueTo(data.GameObject, args); tweenIdentifier++; return(new Tween(id)); }
// The PopOut function. Scales an object down to 0 from its normal size. Good for popping an object out of the world. public static void PopOut(GameObject obj, float time = .2f, float delay = 0, iTween.EaseType easeType = iTween.EaseType.easeInQuad) { if (iTween.Count(obj, "scale") < 1) { iTween.ScaleTo(obj, iTween.Hash("scale", Vector3.zero, "time", time, "delay", delay, "easetype", easeType)); } }
public override void Init() { this.EaseType = (iTween.EaseType)((int)Enum.Parse(typeof(iTween.EaseType), this.m_EaseType)); NrTSingleton <EventTriggerMiniDrama> .Instance.CameraMove(this.GetPosition(), this.m_PosotionMoveTime, this.GetAngles(), this.m_AngleMoveTime, this.m_fieldOfView, this.m_FOVMoveTime, this.m_ActionTime, this.EaseType); this._StartTime = Time.time; }
public static void MoveTo(this RectTransform obj, Vector2 pos, float time, float delay, iTween.EaseType easeType, Action onCompleteDelegate = null) { iTweenEventHandler eventHandler = SetUpEventHandler(obj.gameObject); eventHandler.OnUpdateMoveDelegate = (Vector2 value) => { obj.anchoredPosition = value; }; eventHandler.OnCompleteDelegate = onCompleteDelegate; iTween.ValueTo(obj.gameObject, iTween.Hash( "from", obj.anchoredPosition, "to", pos, "time", time, "delay", delay, "easetype", easeType, "onupdate", "OnUpdateMove", "onupdatetarget", eventHandler.gameObject, "oncomplete", "OnComplete", "oncompletetarget", eventHandler.gameObject )); }
/** * 移动到目标点动画 */ static public void MoveTo(GameObject obj, Vector3 pos, float time, iTween.FunCallback OnUpdate = null, string updateParam = "", iTween.FunCallback OnComplete = null, string completeParam = "", iTween.EaseType type = iTween.EaseType.linear, string loopType = "none") { Hashtable args = new Hashtable(); args.Add("easeType", type); args.Add("time", time); args.Add("loopType", loopType); //移动中调用,参数和上面类似 args.Add("onupdate", updateParam); args.Add("onupdateparams", completeParam); args.Add("x", pos.x); args.Add("y", pos.y); args.Add("z", pos.z); //执行期回调函数 Dictionary <string, iTween.FunCallback> dic = new Dictionary <string, iTween.FunCallback>(); if (OnUpdate != null) { dic.Add("onupdate", OnUpdate); } if (OnComplete != null) { dic.Add("oncomplete", OnComplete); } //最终让改对象开始移动 iTween.MoveTo(obj, args, dic); }
new public void SetEnemyPath(Vector3[] enemyPath, iTween.EaseType easeType, iTween.LoopType loopType) { iTween.Stop(gameObject); // stops any running iTween // move enemy along the path if (loopType == 0) // If not looping, explode at the end of the path { iTween.MoveTo(gameObject, iTween.Hash( "path", enemyPath, "speed", speed * 2, "easeType", easeType, "islocal", true, "movetopath", moveToPath, "looptype", loopType, "oncomplete", "SetNewPath")); } else { iTween.MoveTo(gameObject, iTween.Hash( "path", enemyPath, "speed", speed * 2, "easeType", easeType, "islocal", true, "movetopath", moveToPath, "looptype", loopType)); } }
public void CreatePathAnimation(float from, float to, float time, iTween.EaseType eType = iTween.EaseType.linear, DelegateType.MovePathCallback onComplete = null, DelegateType.MovePathCallback onUpdate = null) { if (to == from) { return; } Hashtable args = new Hashtable(); args.Add("from", from); args.Add("to", to); args.Add("time", time); args.Add("easetype", eType); args.Add("onupdate", "AnimationOnUpdate"); args.Add("onupdatetarget", gameObject); args.Add("oncomplete", "AnimationOnComplete"); args.Add("oncompletetarget", gameObject); args.Add("ignoretimescale", false); iTween.ValueTo(gameObject, args); if (from <= 0.1f) { iLookAtPoint = 2;//ELookAtType.LookAtTwoPoints时才有用 } else if (from >= 0.9f) { iLookAtPoint = 1; } onAnimationComplete = onComplete; onAnimationUpdate = onUpdate; }
private void MoveTo(GameObject go, Vector3 vP, float time, Action <int> act, iTween.EaseType type = iTween.EaseType.linear) { this.movedAct = act; iTween.MoveTo(go, new Hashtable { { "isLocal", true }, { "x", vP.x }, { "y", vP.y }, { "time", time }, { "easetype", type }, { "oncomplete", "MoveEnd" }, { "oncompleteparams", 0 } }); }
public static void TickValue( GameObject go, float time, float from, float to, iTween.EaseType easeType, string name, Action <float> update, Action finish) { iTween.ValueTo(go, iTween.Hash( "name", "iTweenValueTo_" + name, "time", time, "from", from, "to", to, "easetype", easeType, "onupdate", (Action <object>)((x) => { update.Call((float)x); }), "oncomplete", (Action <object>)((x) => { finish.Call(); }) )); }
public void Injection(iTween.EaseType eType, bool isPlaySE, bool isTC, Action callback) { this._actCallback = callback; Hashtable hashtable = new Hashtable(); hashtable.Add("position", this._vecTarget); hashtable.Add("isLocal", false); hashtable.Add("delay", 0.1f); hashtable.Add("time", this._moveTime); hashtable.Add("easeType", eType); hashtable.Add("oncomplete", "_onFinishedInjection"); hashtable.Add("oncompletetarget", base.get_gameObject()); base.get_gameObject().MoveTo(hashtable); base.get_transform().set_rotation(Quaternion.Euler(new Vector3(0f, 0f, 0f))); this._psTorpedoWake.Play(); if (isPlaySE) { if (isTC) { SoundUtils.PlaySE(SEFIleInfos.SE_905); } else { SoundUtils.PlaySE(SEFIleInfos.SE_904); } } }
// Use this for initialization void Start() { ID = System.Guid.NewGuid().ToString(); _easeType = easeType; _loopType = loopType; restart(); }
// RectTransform.MoveTo // Rect Transform을 현재 위치에서 지정한 위치로 이동시키는 애니메이션 public static void MoveTo(this RectTransform target, Vector2 pos, float time, float delay, iTween.EaseType easeType, System.Action onCompleteDelegate = null) { // iTween이 발생시킨 이벤트를 제어하는 핸들러를 설정한다 iTweenEventHandler eventHandler = SetUpEventHandler(target.gameObject); // 이동 애니메이션이 한 스텝 진행될 때마다 호출하는 콜백 메서드를 설정한다 eventHandler.OnUpdateMoveDelegate = (Vector2 value) => { // Rect Transform의 위치를 갱신한다 target.anchoredPosition = value; }; // 애니메이션이 끝났을 때 호출되는 콜백 메서드를 설정한다 eventHandler.OnCompleteDelegate = onCompleteDelegate; // iTween의 ValueTo 메서드를 호출해 애니메이션을 시작한다 iTween.ValueTo(target.gameObject, iTween.Hash( "from", target.anchoredPosition, "to", pos, "time", time, "delay", delay, "easetype", easeType, "onupdate", "OnUpdateMove", "onupdatetarget", eventHandler.gameObject, "oncomplete", "OnComplete", "oncompletetarget", eventHandler.gameObject )); }
public void MoveTo(Vector2 vP, float time, Action <int> act, iTween.EaseType type = iTween.EaseType.linear, float delay = 0f) { if (0f >= time) { this.SetPosX(vP.x); this.SetPosY(vP.y); if (act != null) { act(0); } } else { this.movedAct = act; Hashtable hashtable = new Hashtable(); hashtable.Add("isLocal", true); hashtable.Add("x", vP.x); hashtable.Add("y", vP.y); hashtable.Add("time", EfcCont.GetFixedTime(time)); hashtable.Add("delay", delay); hashtable.Add("easetype", type); hashtable.Add("oncomplete", "MoveEnd"); hashtable.Add("oncompleteparams", 0); iTween.MoveTo(base.gameObject, hashtable); } }
//LookAtTwoPoints专用 public void LookToAnimation(bool bReverse, float time, iTween.EaseType eType = iTween.EaseType.linear, DelegateType.MovePathCallback onComplete = null) { if (elookAtType != ELookAtType.LookAtTwoPoints) { return; } Hashtable args = new Hashtable(); args.Add("from", 0f); args.Add("to", 1f); args.Add("time", time); args.Add("easetype", eType); beginRotation = gameObject.transform.localRotation; if (!bReverse) { args.Add("onupdate", "LookToAnimationUpdate_ToPos2"); args.Add("onupdatetarget", gameObject); finalRotation = Quaternion.LookRotation(posLookAt2 - posEnd); } else { args.Add("onupdate", "LookToAnimationUpdate"); args.Add("onupdatetarget", gameObject); finalRotation = Quaternion.LookRotation(posLookAt1 - posBegin); } args.Add("oncomplete", "LookToAnimationComplete"); args.Add("oncompletetarget", gameObject); args.Add("ignoretimescale", false); iTween.ValueTo(gameObject, args); onLookToComplete = onComplete; isDoingLookTo = true; }
/// <summary> /// Plays the Highlight animation. /// </summary> public void Highlight() { SetupHighlight(); var highlightSize = new Vector3(1.3f, 1.3f, 1.3f); const float time = 0.7f; const iTween.EaseType easeType = iTween.EaseType.easeOutCubic; iTween.ScaleTo(_highlightImage, iTween.Hash( "name", "HighlightScaleUp", "scale", highlightSize, "time", time, "easetype", easeType )); iTween.ValueTo(gameObject, iTween.Hash( "name", "HighlightFadoOut", "from", _maintImage.GetComponent <Image>().color.a, "to", 0f, "time", time, "easetype", easeType, "onupdate", "ColorUpdate" )); }
/// <summary> /// Moves the object to the specified empty slot. /// </summary> /// <param name="emptySlot">The empty slot.</param> public void Move(Transform emptySlot) { SetupMove(); const float time = 0.5f; const iTween.EaseType easeType = iTween.EaseType.easeOutBounce; iTween.ValueTo(gameObject, iTween.Hash( "name", "MoveOffsetMin", "from", _mainRect.offsetMin, "to", new Vector2(GlobalConstants.DotToCellPadding, GlobalConstants.DotToCellPadding), "time", time, "easetype", easeType, "onupdate", "OffsetMinUpdate" )); iTween.ValueTo(gameObject, iTween.Hash( "name", "MoveOffsetMax", "from", _mainRect.offsetMax, "to", new Vector2(-GlobalConstants.DotToCellPadding, -GlobalConstants.DotToCellPadding), // - because offsetMax is inversed "time", time, "easetype", easeType, "onupdate", "OffsetMaxUpdate" )); }
public void ScaleTo(float to, float duration, bool resetAfterComplete = true, iTween.EaseType ease = iTween.EaseType.easeOutQuad) { audioSource.clip = GetAudio(to); audioSource.Play(); iTween.Stop(gameObject); iTween.ValueTo(gameObject, GetHash(to, duration, resetAfterComplete, ease)); }
private void DoTweens() { _elapsedTime = 0; GameObject go = Fsm.GetOwnerDefaultTarget(transformObject); Vector3 position = isLocal.Value ? destinationObject.Value.transform.localPosition : destinationObject.Value.transform.position; Vector3 rotation = isLocal.Value ? destinationObject.Value.transform.localEulerAngles : destinationObject.Value.transform.eulerAngles; Vector3 scale = destinationObject.Value.transform.localScale; iTween.EaseType rawEaseType = (iTween.EaseType)easeType.Value; iTween.MoveTo(go, iTween.Hash("position", position, "time", animationTime.Value, "easetype", rawEaseType, "islocal", isLocal.Value)); iTween.RotateTo(go, iTween.Hash("rotation", rotation, "time", animationTime.Value, "easetype", rawEaseType, "islocal", isLocal.Value)); iTween.ScaleTo(go, iTween.Hash("scale", scale, "time", animationTime.Value, "easetype", rawEaseType)); //TODO: RectTransform tweening wont work for all cases, this should be made more flexible to take into account anchors, offsets, etc _rectTransform = go.transform as RectTransform; if (_rectTransform != null) { RectTransform destTransform = destinationObject.Value.transform as RectTransform; if (destTransform != null) { _oldRectSize = _rectTransform.rect.size; _newRectSize = destTransform.rect.size; } else { _rectTransform = null; } } }
public void ducTime(float _to, float _duration, iTween.EaseType easeType = iTween.EaseType.easeOutCubic, bool bDucAudio = false) { Interactivity interactivity = null; if (bDucAudio == true) { var go = GameObject.Find("__Interactivity"); if (go) { interactivity = go.GetComponent <Interactivity>(); } if (interactivity == null) { Debug.LogError("Unable to find __Interactivity"); } } var fullSpeed = playbackSpeedInFramesPerSecond / 30.0f; var from = Time.timeScale; Debug.Log(string.Format("duc {0} > {1}", from, _to)); if (from == _to) { return; } var id = "CinematronDucTween"; iTween.StopByName(gameObject, id); iTween.ValueTo(gameObject, iTween.Hash("name", id, "from", 0.0f, "to", 1.0f, "time", _duration, "easetype", easeType, "ignoretimescale", true, "onUpdate", (System.Action <object>)((x) => { float f = Mathf.Clamp01((float)x); var ts = Mathf.Lerp(from, _to, f); Time.timeScale = ts; if (bDucAudio == true) { AudioListener.volume = Mathf.Clamp(f, 0.0f, 1.0f); foreach (var a in interactivity.allAudios) { if (a.isPlaying && a.gameObject.activeInHierarchy && a.gameObject.activeSelf) { a.pitch = ts * (1 / fullSpeed) * (playbackSpeedInFramesPerSecond / musicSpeedInFramesPerSecond); } } } }), "onComplete", (System.Action <object>)((x) => { Time.timeScale = _to; if (bDucAudio == true) { resyncMusic(); } }))); }
public void glideToNextPosition() { if (moveIndex < moveTargets.Count) { float moveDuration = 0.15f; iTween.EaseType movementType = iTween.EaseType.linear; if (moveIndex + 1 < moveTargets.Count) { if (moveTargets[moveIndex + 1].GetComponent <CibleDeplacementIHM>().jumpingTarget) { // Debug.Log("jump"); moveDuration *= 2; iTween.ScaleTo(gameObject, iTween.Hash("scale", notPlacedScale, "time", moveDuration, "easetype", iTween.EaseType.easeOutQuart, "oncomplete", "restoreScaleAfterJump")); } } else if (moveTargets[moveIndex].GetComponent <CibleDeplacementIHM>().jumpingTarget) { moveDuration *= 2; } if (moveTargets[moveIndex].GetComponent <CibleDeplacementIHM>().wallwalkTarget) { moveDuration *= 2; movementType = iTween.EaseType.easeInOutSine; } iTween.MoveTo(gameObject, iTween.Hash("position", moveTargets[moveIndex].transform.position, "time", moveDuration, "easetype", movementType, "oncomplete", "glideToNextPosition")); moveIndex++; } // Une fois le token arrivé sur la case de destination else { pickUpOverflownToken(); if (associatedToken.selected) { transform.position = new Vector3(transform.position.x, transform.position.y, -1); } else { transform.position = new Vector3(transform.position.x, transform.position.y, 0); } if (gManager.activePlayer.isScriptedPlayer()) { waitBeforeEndingMove(); } else if (gManager.onlineGameInterface.isOnlineOpponent(gManager.activePlayer.index) && moveTargets[moveIndex - 1].GetComponent <CibleDeplacementIHM>().jumpingTarget) { waitBeforeEndingMove(); } else { moveIndex = 0; gliding = false; Debug.Assert(gManager.actionCharacter.GetComponent <CharacterBehaviorIHM>() == this, "the character gliding should be actionCharacter"); recomputePossibleActionsIHM(false, true); gManager.onlineGameInterface.EndReplayAction(); } } }
public static void ScaleFrom(this GameObject go, Vector2 scale, float time, iTween.EaseType ease = iTween.EaseType.linear) { iTween.ScaleFrom(go, iTween.Hash("x", scale.x, "y", scale.y, "time", time, "easetype", ease)); }
public BaseSetting() { onStart = false; time = 1; delay = 0; easeType = iTween.EaseType.linear; loopType = iTween.LoopType.none; }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tonumber(L, 1); iTween.EaseType o = (iTween.EaseType)arg0; LuaScriptMgr.Push(L, o); return(1); }
public IEnumerator MenuOutTo(GameObject menu, Vector3 to, float time, iTween.EaseType easeType) { iTween.Stop(menu, "move"); iTween.MoveTo(menu, iTween.Hash("x", to.x, "y", to.y, "time", time, "ignoretimescale", true, "easetype", easeType)); yield return(StartCoroutine(CoreMethods.Wait(time))); //iTween.Stop(menu, "move"); }
public void AnimateToTargetPosition(float animationTime, iTween.EaseType easeType) { object[] args = new object[] { "position", this.m_targetLocalPos, "isLocal", true, "time", animationTime, "easetype", easeType, "name", "position", "oncomplete", "OnMovedToTargetPos", "onompletetarget", base.gameObject }; Hashtable hashtable = iTween.Hash(args); iTween.StopByName(base.gameObject, "position"); iTween.MoveTo(base.gameObject, hashtable); }
// The Rock function. Rotates an object back and forth indefinitely. Good for rotating objects back and forth indefinitely ;) public static void Rock(GameObject obj, float amount = 10, float time = 1.5f, iTween.EaseType easeType = iTween.EaseType.easeInOutCubic) { if (iTween.Count(obj, "rotate") < 1) { obj.transform.Rotate(0, 0, -amount); iTween.RotateBy(obj, iTween.Hash("amount", new Vector3(0, 0, 2 * amount / 360), "time", time, "easetype", easeType, "looptype", "pingPong")); } }
public iTweenStruct(Vector3 currentPos, Vector3 startPos, Vector3 endPos, GameObject itemToTween, iTween.EaseType easeType) { this.itemToTween = itemToTween; this.currentPos = currentPos; this.startPos = startPos; this.endPos = endPos; this.easeType = easeType; }
// Use this for initialization public IEnumerator StartIt (float delayModifier) { yield return new WaitForSeconds(time * (1f - delayModifier)); time = time * delayModifier; easeType = iTween.EaseType.easeInCubic; Hashtable hash = new Hashtable(); hash.Add("oncomplete", "AnimationFinished"); hash.Add("time", time); hash.Add("isLocal", true); hash.Add("position", localPositionToMoveTo); hash.Add("easetype", easeType); iTween.MoveTo(gameObject, hash); transform.localScale = new Vector3(delayModifier * delayModifier * delayModifier * delayModifier * 10f, 3f, 3f); easeType = iTween.EaseType.easeOutCubic; hash = new Hashtable(); hash.Add("oncomplete", "AnimationFinished"); hash.Add("time", time); hash.Add("isLocal", true); hash.Add("scale", new Vector3(delayModifier * delayModifier * .5f, 1f, 1f)); hash.Add("easetype", easeType); iTween.ScaleTo(gameObject, hash); particleSystem.startSize *= delayModifier; particleSystem.Play(); }
//grab and set generic, neccesary iTween arguments: void RetrieveArgs() { foreach (Hashtable item in tweens) { if((GameObject)item["target"] == gameObject){ tweenArguments=item; break; } } id=(string)tweenArguments["id"]; type=(string)tweenArguments["type"]; /* GFX47 MOD START */ _name=(string)tweenArguments["name"]; /* GFX47 MOD END */ method=(string)tweenArguments["method"]; if(tweenArguments.Contains("time")){ time=(float)tweenArguments["time"]; }else{ time=Defaults.time; } //do we need to use physics, is there a rigidbody? if(rigidbody != null){ physics=true; } if(tweenArguments.Contains("delay")){ delay=(float)tweenArguments["delay"]; }else{ delay=Defaults.delay; } if(tweenArguments.Contains("namedcolorvalue")){ //allows namedcolorvalue to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["namedcolorvalue"].GetType() == typeof(NamedValueColor)){ namedcolorvalue=(NamedValueColor)tweenArguments["namedcolorvalue"]; }else{ try { namedcolorvalue=(NamedValueColor)Enum.Parse(typeof(NamedValueColor),(string)tweenArguments["namedcolorvalue"],true); } catch { Debug.LogWarning("iTween: Unsupported namedcolorvalue supplied! Default will be used."); namedcolorvalue = iTween.NamedValueColor._Color; } } }else{ namedcolorvalue=Defaults.namedColorValue; } if(tweenArguments.Contains("looptype")){ //allows loopType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["looptype"].GetType() == typeof(LoopType)){ loopType=(LoopType)tweenArguments["looptype"]; }else{ try { loopType=(LoopType)Enum.Parse(typeof(LoopType),(string)tweenArguments["looptype"],true); } catch { Debug.LogWarning("iTween: Unsupported loopType supplied! Default will be used."); loopType = iTween.LoopType.none; } } }else{ loopType = iTween.LoopType.none; } if(tweenArguments.Contains("easetype")){ //allows easeType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["easetype"].GetType() == typeof(EaseType)){ easeType=(EaseType)tweenArguments["easetype"]; }else{ try { easeType=(EaseType)Enum.Parse(typeof(EaseType),(string)tweenArguments["easetype"],true); } catch { Debug.LogWarning("iTween: Unsupported easeType supplied! Default will be used."); easeType=Defaults.easeType; } } }else{ easeType=Defaults.easeType; } if(tweenArguments.Contains("space")){ //allows space to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability: if(tweenArguments["space"].GetType() == typeof(Space)){ space=(Space)tweenArguments["space"]; }else{ try { space=(Space)Enum.Parse(typeof(Space),(string)tweenArguments["space"],true); } catch { Debug.LogWarning("iTween: Unsupported space supplied! Default will be used."); space = Defaults.space; } } }else{ space = Defaults.space; } if(tweenArguments.Contains("islocal")){ isLocal = (bool)tweenArguments["islocal"]; }else{ isLocal = Defaults.isLocal; } // Added by PressPlay if (tweenArguments.Contains("ignoretimescale")) { useRealTime = (bool)tweenArguments["ignoretimescale"]; } else { useRealTime = Defaults.useRealTime; } //instantiates a cached ease equation reference: GetEasingFunction(); }
private void RetrieveArgs() { foreach (Hashtable hashtable in iTween.tweens) { if ((GameObject)hashtable["target"] == base.gameObject) { this.tweenArguments = hashtable; break; } } this.id = (string)this.tweenArguments["id"]; this.type = (string)this.tweenArguments["type"]; this._name = (string)this.tweenArguments["name"]; this.method = (string)this.tweenArguments["method"]; if (this.tweenArguments.Contains("time")) { this.time = (float)this.tweenArguments["time"]; } else { this.time = iTween.Defaults.time; } if (base.GetComponent<Rigidbody>() != null) { this.physics = true; } if (this.tweenArguments.Contains("delay")) { this.delay = (float)this.tweenArguments["delay"]; } else { this.delay = iTween.Defaults.delay; } if (this.tweenArguments.Contains("namedcolorvalue")) { if (this.tweenArguments["namedcolorvalue"].GetType() == typeof(iTween.NamedValueColor)) { this.namedcolorvalue = (iTween.NamedValueColor)((int)this.tweenArguments["namedcolorvalue"]); } else { try { this.namedcolorvalue = (iTween.NamedValueColor)((int)Enum.Parse(typeof(iTween.NamedValueColor), (string)this.tweenArguments["namedcolorvalue"], true)); } catch { UnityEngine.Debug.LogWarning("iTween: Unsupported namedcolorvalue supplied! Default will be used."); this.namedcolorvalue = iTween.NamedValueColor._Color; } } } else { this.namedcolorvalue = iTween.Defaults.namedColorValue; } if (this.tweenArguments.Contains("looptype")) { if (this.tweenArguments["looptype"].GetType() == typeof(iTween.LoopType)) { this.loopType = (iTween.LoopType)((int)this.tweenArguments["looptype"]); } else { try { this.loopType = (iTween.LoopType)((int)Enum.Parse(typeof(iTween.LoopType), (string)this.tweenArguments["looptype"], true)); } catch { UnityEngine.Debug.LogWarning("iTween: Unsupported loopType supplied! Default will be used."); this.loopType = iTween.LoopType.none; } } } else { this.loopType = iTween.LoopType.none; } if (this.tweenArguments.Contains("easetype")) { if (this.tweenArguments["easetype"].GetType() == typeof(iTween.EaseType)) { this.easeType = (iTween.EaseType)((int)this.tweenArguments["easetype"]); } else { try { this.easeType = (iTween.EaseType)((int)Enum.Parse(typeof(iTween.EaseType), (string)this.tweenArguments["easetype"], true)); } catch { UnityEngine.Debug.LogWarning("iTween: Unsupported easeType supplied! Default will be used."); this.easeType = iTween.Defaults.easeType; } } } else { this.easeType = iTween.Defaults.easeType; } if (this.tweenArguments.Contains("space")) { if (this.tweenArguments["space"].GetType() == typeof(Space)) { this.space = (Space)((int)this.tweenArguments["space"]); } else { try { this.space = (Space)((int)Enum.Parse(typeof(Space), (string)this.tweenArguments["space"], true)); } catch { UnityEngine.Debug.LogWarning("iTween: Unsupported space supplied! Default will be used."); this.space = iTween.Defaults.space; } } } else { this.space = iTween.Defaults.space; } if (this.tweenArguments.Contains("islocal")) { this.isLocal = (bool)this.tweenArguments["islocal"]; } else { this.isLocal = iTween.Defaults.isLocal; } if (this.tweenArguments.Contains("ignoretimescale")) { this.useRealTime = (bool)this.tweenArguments["ignoretimescale"]; } else { this.useRealTime = iTween.Defaults.useRealTime; } this.GetEasingFunction(); }
override public void setEaseType(iTween.EaseType value) { m_easeType = value; }
public iTweener EaseType(iTween.EaseType easeType) { _easeType = easeType; return this; }