Version: 2.0.5
Author: Bob Berkebile (http://pixelplacement.com)
Support: http://itween.pixelplacement.com
// 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 TriggerRemovePointNpc(int key) { if (IsDeathNPC) { return; } IsDeathNPC = true; CancelInvoke("DelayMoveNpcWaitAnimationEnd"); iTween itweenScript = GetComponent <iTween>(); if (itweenScript != null) { itweenScript.isRunning = false; itweenScript.isPaused = true; Destroy(itweenScript); } if (key == 0) { StartCoroutine(DestroyNetNpcObj(NpcObj)); } else { StartCoroutine(DestroyNetNpcObj(NpcObj, 3f)); } }
void Update() { if (IsOnFinishMove) { return; } if (TimeScaleVal == Time.timeScale) { return; } TimeScaleVal = Time.timeScale; iTween iTweenScript = GetComponent <iTween>(); if (iTweenScript == null) { return; } iTweenScript.isPaused = true; DestroyObject(iTweenScript); MvSpeed *= Time.timeScale; //Debug.Log("MvSpeed "+MvSpeed+", timeScale "+Time.timeScale); Vector3[] posArray = new Vector3[2]; posArray[0] = AmmoTran.position; posArray[1] = AmmoEndPos; iTween.MoveTo(ObjAmmo, iTween.Hash("path", posArray, "speed", MvSpeed, "orienttopath", true, "easeType", iTween.EaseType.linear, "oncomplete", "MoveAmmoOnCompelteITween")); }
public void StartFocusing() { iTween rotationAnimation = (iTween)this.gameObject.GetComponent <iTween>(); rotationAnimation.time = 0.5f; _isFocusing = true; }
public void StopFocusing() { iTween rotationAnimation = (iTween)this.gameObject.GetComponent <iTween>(); rotationAnimation.time = 3f; _isFocusing = false; }
public void StartAnimation(GameObject _gameObject) { // if (gameObject == null) // gameObject = _gameObject; if (gameObject.GetComponent <iTween> () == null) { iTween.MoveTo(gameObject, gameObject.transform.position, 0); } Type mytype = typeof(iTweenAnimation); FieldInfo[] myFields = mytype.GetFields(); iTween itween = gameObject.GetComponent <iTween> (); Hashtable hash = new Hashtable(); // foreach (MyHashObject item in table) { // hash.Add (item.Key, getValue (item)); // } for (int i = 0; i < myFields.Length; i++) { hash.Add(myFields [i].Name, myFields [i].GetValue(this)); } object[] parameters = new object[2]; parameters [0] = gameObject; parameters [1] = hash; MethodInfo theMethod = itween.GetType().GetMethod(animation.ToString(), new Type[] { typeof(GameObject), typeof(Hashtable) }); // Debug.Log (theMethod); theMethod.Invoke(this, parameters); }
void OnTriggerEnter(Collider other) { Debug.Log("Something hit an enemy4".Colored(Colors.navy)); Projectile playerBullet = other.gameObject.GetComponent <Projectile>(); if (playerBullet) { health -= playerBullet.GetDamage(); playerBullet.Hit(); Debug.Log(gameObject.name.Colored(Colors.red).Bold() + " Enemy hit!".Bold().Colored(Colors.red)); // BEE: if formation = 50 points, diving == 100 if (isNotInFormation) { scoreKeeper.Score(100); } else { scoreKeeper.Score(50); } if (health <= 0) { top = base.addShotSounds(explosionTop[GalagaHelper.RandomNumber(0, explosionTop.Length)], Random.Range(0.8f, 1.2f)); bottom = base.addShotSounds(explosionBottom, Random.Range(0.8f, 1.2f)); top.PlayScheduled(0.3); bottom.Play(); //rend.enabled = false; //meshcol.enabled = false; GameObject explosionPrefab = Instantiate(explosion, gameObject.transform.position, gameObject.transform.rotation) as GameObject; Destroy(explosionPrefab, 3.0f); //Debug.Log("Enemy1 killed: " + gameObject.name.Colored(Colors.blue) + " Parent: " + gameObject.transform.parent.parent.name.Colored(Colors.blue) + " Position: " + gameObject.transform.parent.name.Colored(Colors.blue)); this.isEnemyFiring = false; DisableEnemy(); //Invoke("DisableEnemy", spawnDisableTime); GalagaHelper.EnemiesKilled += 1; if (base.isRandomPicked == true) { isRandomPicked = false; main.isEnemy1Done = true; } iTween onTween = gameObject.GetComponent <iTween>(); if (onTween) { if (onTween.isRunning) { Debug.Log("Enemy4 Killed during Itween".Colored(Colors.red).Bold()); GalagaHelper.isScorpionAttackOn = false; //onTween.isRunning = false; //GalagaHelper.EnemiesSpawned += 1; } } //if (startScorpionAttack) //{ // startScorpionAttack = false; //} SimplePool.Despawn(gameObject); } } }
// Update is called once per frame void Update() { if (PlayerStatus.playerStatus.lives <= 0) { itwen = GetComponent <iTween>(); itwen.enabled = false; } }
private void OnDestroy() { CleanRunData(); cachePathTweenHashParam = null; cacheBezierTweenHashParam = null; tween = null; }
// Update is called once per frame void Update() { if(PlayerStatus.playerStatus.lives <= 0) { itwen = GetComponent<iTween>(); itwen.enabled = false; } }
public static void Remove(iTween tween) { iTweenManager manager = Get(); if (manager != null) { manager.RemoveImpl(tween); } }
public static void Add(iTween tween) { iTweenManager manager = Get(); if (manager != null) { manager.AddImpl(tween); } }
void Update() { if (!XkGameCtrl.IsActivePlayerOne && !XkGameCtrl.IsActivePlayerTwo) { if (!XkGameCtrl.IsMoveOnPlayerDeath) { if (ITweenScriptNpc == null) { ITweenScriptNpc = GetComponent <iTween>(); } if (ITweenScriptNpc != null && ITweenScriptNpc.isRunning) { ITweenScriptNpc.isRunning = false; } return; } } else { if (ITweenScriptNpc != null && !ITweenScriptNpc.isRunning) { ITweenScriptNpc.isRunning = true; } } if (!ScreenDanHeiCtrl.IsStartGame) { return; } if (IsDeathNPC) { return; } if (IsMoveEndPoint && NpcPathScript.IsMoveEndFire) { return; } if (NpcTran == null) { return; } if (!IsMoveToFirePoint && FireDistance > 0f) { Vector3 posA = NpcTran.position; Vector3 posB = XkPlayerCtrl.PlayerTranFeiJi.position; posA.y = posB.y = 0f; if (Vector3.Distance(posA, posB) <= FireDistance) { MoveFangZhenNpcToFirePoint(); } } }
/// <summary> /// iTweenの時のみ使用可能 /// </summary> public void setMovingStop_iTween() { iTween thisiTween = this.gameObject.GetComponent <iTween> (); if (thisiTween != null) { thisiTween.isRunning = false; } }
public void colorFadeTo(Color clr, float fTime = 0.2f, iTween.LoopType loopType = iTween.LoopType.pingPong) { Hashtable hs = new Hashtable(); hs.Add("Color", clr); hs.Add("time", fTime); hs.Add("looptype", loopType); hs.Add("type", m_strColorFadeTo); iTween.ColorTo(this.gameObject, hs); }
void OnComplete() { iTween tween = gameObject.GetComponent <iTween>(); if (tween != null) { tween.enabled = false; } }
void DelayRemoveNpcAmmo() { iTween itweenScript = GetComponent <iTween>(); if (itweenScript != null) { itweenScript.isRunning = false; } RemoveAmmo(); }
public void TweenYScale(float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo) { iTween.ScaleTo(gameObject, iTween.Hash( "y", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
private void OnEnable() { global::Debug.Log("============================= ITweenResumer was enabled"); iTween component = base.gameObject.GetComponent <iTween>(); if (component != null) { iTween.Resume(base.gameObject); } }
public void OnTriggerEnter(Collider other) { //Debug.Log("Something hit an enemy"); Projectile playerBullet = other.gameObject.GetComponent <Projectile>(); if (playerBullet) { health -= playerBullet.GetDamage(); playerBullet.Hit(); Debug.Log(gameObject.name.Colored(Colors.red).Bold() + " Enemy hit!".Bold().Colored(Colors.red)); // Butterfly: if formation = 80 points, diving == 160 if (isNotInFormation) { scoreKeeper.Score(160); } else { scoreKeeper.Score(80); } if (health <= 0) { top = base.addShotSounds(explosionTop[Random.Range(0, explosionTop.Length)], Random.Range(0.8f, 1.2f)); bottom = base.addShotSounds(explosionBottom, Random.Range(0.8f, 1.2f)); top.PlayScheduled(0.3); bottom.Play(); rend.enabled = false; meshcol.enabled = false; GameObject explosionPrefab = Instantiate(explosion, gameObject.transform.position, gameObject.transform.rotation) as GameObject; Destroy(explosionPrefab, 3.0f); //Debug.Log("Enemy2 killed: " + gameObject.name.Colored(Colors.blue) + " Parent: " + gameObject.transform.parent.parent.name.Colored(Colors.blue)+ " Position: " + gameObject.transform.parent.name.Colored(Colors.blue)); //GalagaHelper.DisabledEnemies += 1; this.isEnemyFiring = false; RunawayFromParent(); GalagaHelper.EnemiesKilled += 1; if (base.isRandomPicked == true) { isRandomPicked = false; main.isEnemy2Done = true; } iTween onTween = gameObject.GetComponent <iTween>(); if (onTween) { if (onTween.isRunning) { Debug.Log("Enemy2 Killed during Itween".Colored(Colors.red).Bold()); //onTween.isRunning = false; GalagaHelper.EnemiesSpawned += 1; } } SimplePool.Despawn(gameObject); } } }
private void Update() { iTween component = this.m_mapViewContentsRT.GetComponent <iTween>(); bool flag = component != null; if (Input.touchCount == 2) { MapInfo componentInChildren = base.GetComponentInChildren <MapInfo>(); if (componentInChildren == null) { return; } Touch touch = Input.GetTouch(0); Touch touch2 = Input.GetTouch(1); if (!this.m_isPinching) { this.m_isPinching = true; this.m_scrollRect.enabled = false; } Vector2 vector = touch.position - touch.deltaPosition; Vector2 vector2 = touch2.position - touch2.deltaPosition; float magnitude = (vector - vector2).magnitude; float magnitude2 = (touch.position - touch2.position).magnitude; float num = magnitude - magnitude2; float num2 = num * -this.m_zoomSpeed; Vector2 vector3 = (touch.position + touch2.position) / 2f; Ray ray = Camera.main.ScreenPointToRay(vector3); if (AdventureMapPanel.instance.m_testEnableAutoZoomInOut) { if (!flag) { if (num2 > this.m_zoomInThreshold) { AdventureMapPanel.instance.CenterAndZoom(ray.origin, null, true); return; } if (num2 < -this.m_zoomOutThreshold) { AdventureMapPanel.instance.CenterAndZoom(ray.origin, null, false); return; } } return; } float num3 = this.m_zoomFactor; num3 += num2; num3 = Mathf.Clamp(num3, componentInChildren.m_minZoomFactor, componentInChildren.m_maxZoomFactor); this.SetZoom(num3, ray.origin, false); } else { this.m_isPinching = false; this.m_scrollRect.enabled = true; } }
public void TweenRotationFrom(Vector3 from, Vector3 to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, bool isLocal = false) { transform.rotation = Quaternion.Euler(from); iTween.RotateTo(gameObject, iTween.Hash( "rotation", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
public void TweenYScaleFrom(float from, float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo) { transform.localScale = Vector3.one * from; iTween.ScaleTo(gameObject, iTween.Hash( "y", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
public void TweenXPosition(float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, bool isLocal = false) { iTween.MoveTo(gameObject, iTween.Hash( "x", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "easetype", easeType, "name", TweenName, "islocal", isLocal)); }
void Start() { Tween = GetComponent <iTween>(); rigid = move.GetComponent <Rigidbody>(); pos = new Vector3(); // 라인따라 이동함 iTween.MoveTo(gameObject, iTween.Hash("path", path, "time", 50, "easetype", iTween.EaseType.linear, "orienttopath", true, "looktime", .6, "looptype", iTween.LoopType.loop, "movetopath", false)); }
public void OnPause() { pauseCanvas.SetActive(true); Common.isRunning = false; Time.timeScale = 0; playerTween = player.GetComponent <iTween>(); if (playerTween != null) { playerTween.isRunning = false; } }
public void TweenRotation(Vector3 to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, bool isLocal = false) { iTween.RotateTo(gameObject, iTween.Hash( "rotation", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "islocal", isLocal, "easetype", easeType)); }
void OnLoseCamMoveComplete() { iTween tween = gameObject.GetComponent <iTween>(); if (tween != null) { tween.enabled = false; } NotifyAllListeners(PathType.eLosePath); }
public void MoveTo(float fromValue, float toValue, float time, TweenFunction func, iTween.EaseType ease) { Vector3 pos = transform.position; pos.x = fromValue; transform.position = pos; _toValue = toValue; iTween.MoveTo(gameObject, iTween.Hash("x", toValue, "time", time, "easeType", ease, "oncomplete", "onTweenComplete", "oncompletetarget", gameObject)); eventFunction = func; }
void CreateItween() { if (tweenInstance == null && !atataraina.isLevDied) { iTween.ShakePosition(plank, iTween.Hash("y", shakeAmount, "time", timeShaking, "easetype", iTween.EaseType.linear, "oncomplete", "StartDelay", "oncompletetarget", this.gameObject)); tweenInstance = plank.GetComponent <iTween> (); } }
private void ScalePanel(Transform target, float scaleX, float scaleY, float time, float delay, iTween.EaseType easing, string onComplete) { Hashtable ht = new Hashtable(); ht.Add("x", scaleX); ht.Add("y", scaleY); ht.Add("time", time); ht.Add("delay", delay); ht.Add("easetype", easing); ht.Add("oncomplete", onComplete); iTween.ScaleTo(target.gameObject, ht); }
public void ResetPosition() { iTween it = GetComponent <iTween> (); if (it != null) { iTween.Stop(gameObject); } Vector3 newPos = target.transform.localPosition; transform.localPosition = newPos; }
public void TweenYRotationFrom(float from, float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, bool isLocal = false) { transform.rotation = Quaternion.Euler(transform.position.x, from, transform.position.z); iTween.RotateTo(gameObject, iTween.Hash( "y", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "islocal", isLocal, "easetype", easeType)); }
public void TweenXYPosition(Vector2 to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, iTween.LoopType loopType = iTween.LoopType.none, bool isLocal = false) { StopTween(); iTween.MoveTo(gameObject, iTween.Hash( "position", new Vector3(to.x, to.y, transform.position.z), "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType, "looptype",loopType,"islocal", isLocal)); }
public void TweenXYPositionFrom(Vector2 from, Vector2 to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo) { StopTween(); transform.position = new Vector3(from.x, from.y, transform.position.z); iTween.MoveTo(gameObject, iTween.Hash( "position", new Vector3(to.x, to.y, transform.position.z), "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
public void TweenXPositionFrom(float from, float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo, bool isLocal = false) { transform.position = new Vector3(from, transform.position.y, transform.position.z); iTween.MoveTo(gameObject, iTween.Hash( "x", to, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "easetype", easeType, "name", TweenName, "islocal", isLocal)); }
void OnDisable() { if (_path != null) { _path.enabled = false; } iTween tween = gameObject.GetComponent <iTween>(); if (tween != null) { tween.enabled = false; } }
public void Tween(float to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo) { StopTween(); iTween.ValueTo(gameObject, iTween.Hash( "from", audioSource.volume, "to", to, "time", time, "delay", delay, "onupdate", "UpdateSize", "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
public ManMoveable(GameObject target, ManMoveable manMoveable) { setTarget(target); if (manMoveable != null) { Old_Pos = manMoveable.Old_Pos; New_Pos = manMoveable.New_Pos; dirX = manMoveable.dirX; dirY = manMoveable.dirY; tempitw = manMoveable.tempitw; climbHeigh = manMoveable.climbHeigh + 1; } }
/// <summary> /// Tween処理開始 /// </summary> public void Play() { if (TryStoreOldTween()) { } isPlaying = true; if (data.Type == iTweenType.Stop) { iTween.Stop(gameObject); return; } //GetComponentsして前後で新しくできたものを取得するための準備 var oldTweens = this.GetComponents <iTween>(); PlaySub(); if (!IsPlaying) { return; } //開始されたTweenが取得できないので //GetComponentsして前後で新しくできたものを取得する var newTweens = this.GetComponents <iTween>(); Tween = null; foreach (var newTween in newTweens) { bool isFind = false; foreach (var oldTween in oldTweens) { if (oldTween == newTween) { isFind = true; break; } } if (!isFind) { Tween = newTween; break; } } if (Tween == null) { Debug.LogError("Tween is missing"); } }
// Update is called once per frame void Update() { if (easeType != _easeType || loopType != _loopType) { _easeType = easeType; _loopType = loopType; iTween comp = iTween.getById(gameObject, ID); if (null != comp) { comp.easeType = _easeType; comp.loopType = _loopType; } } }
public void FadeTo(string channel, float value, float duration, iTween.EaseType ease) { iTween.StopByName (this.gameObject, "Set"+channel); float fromValue = 0f; audioMixer.GetFloat (channel, out fromValue); Hashtable ht = new Hashtable (); ht.Add ("name", "Set"+channel); ht.Add ("from", fromValue); ht.Add ("to", value); ht.Add ("time", duration); ht.Add ("onupdate", "Set"+channel); ht.Add ("easetype", ease); iTween.ValueTo(gameObject, ht); }
public void MoveTile(Tile tile, Vector3 targetPosition, float speed, iTween.EaseType easeType) { string tweenName = "MoveTile(" + tile.TilePosition.x + "," + tile.TilePosition.y + ")"; float targetPositionX = targetPosition.x; float targetPositionY= targetPosition.y; float targetPositionZ = targetPosition.z; string onStart = "MoveTileStart"; GameObject onStartTarget = gameObject; string onComplete = "MoveTileComplete"; GameObject onCompleteTarget = gameObject; iTween.MoveTo(tile.gameObject, iTween.Hash("name", tweenName, "x", targetPositionX, "y", targetPositionY, "z", targetPositionZ, "easeType", easeType, "speed", speed, "onstart", onStart, "onstarttarget", onStartTarget, "oncomplete", onComplete, "oncompletetarget", onCompleteTarget)); }
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", "Explode")); else iTween.MoveTo(gameObject, iTween.Hash( "path", enemyPath, "speed", speed*2, "easeType", easeType, "islocal", true, "movetopath", moveToPath, "looptype", loopType)); }
//値の変化を変えるiTween.ValueToをラップしたメソッド private void ValueTransition(float from, float to, float duration, float delay, string update, iTween.EaseType easetype) { iTween.ValueTo (gameObject, iTween.Hash ( "from", from, "to", to, "time", duration, "delay", delay, "onupdate", update, "easetype", easetype )); }
override public void setEaseType(iTween.EaseType value) { m_easeType = value; }
private static Hashtable getBasicHs(Vector3 amount, float time, float delay, iTween.EaseType easeType) { Hashtable hs = new Hashtable (); hs.Add ("amount", amount); hs.Add ("time", time); hs.Add ("delay", delay); hs.Add ("space", Space.World); hs.Add ("easetype", easeType.ToString ()); return hs; }
public void TweenYPosition(Transform to, float time, float delay = 0f, iTween.EaseType easeType = iTween.EaseType.easeOutExpo) { StopTween(); iTween.MoveTo(gameObject, iTween.Hash( "y", to.position.y, "time", time, "delay", delay, "ignoretimescale", ignoreTimeScale, "name", TweenName, "easetype", easeType)); }
private static Hashtable getBasicHsWithSpeed(Vector3 amount, float speed, float delay, iTween.EaseType easeType) { Hashtable hs = new Hashtable (); hs.Add ("amount", amount); hs.Add ("speed", speed); hs.Add ("delay", delay); hs.Add ("space", Space.World); hs.Add ("easetype", easeType); return hs; }
// Use this for initialization void Start() { itwen = GetComponent<iTween>(); }
public iTweener EaseType(iTween.EaseType easeType) { _easeType = easeType; return this; }
virtual public void setLoopType(iTween.LoopType value) { }
virtual public void setEaseType(iTween.EaseType value) { }
public void ShakeCamera(Vector3 v,float t) { itween= gameObject.GetComponent<iTween>(); if(itween!=null) { //Debug.Log(itween.type + itween.method); if (itween.method == "position" && itween.type == "shake") { // itween.StopCoroutine("position"); //iTween.Stop(gameObject);//gameObject, "shake" //Debug.Log("12"); //Debug.Log(itween.type + itween.method); //iTween.ShakePosition(gameObject, v, t); } } iTween.ShakePosition(gameObject, v, t); itween = gameObject.GetComponent<iTween>(); // if (itween != null) // Debug.Log("shake"); }
public iTweener LoopType( iTween.LoopType loopType ) { _loopType = loopType; return this; }
override public void setLoopType(iTween.LoopType value) { m_loopType = value; }