Version: 2.0.5

Author: Bob Berkebile (http://pixelplacement.com)

Support: http://itween.pixelplacement.com

Inheritance: MonoBehaviour
Esempio n. 1
0
    // 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
        ));
    }
Esempio n. 2
0
    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"));
    }
Esempio n. 4
0
    public void StartFocusing()
    {
        iTween rotationAnimation = (iTween)this.gameObject.GetComponent <iTween>();

        rotationAnimation.time = 0.5f;
        _isFocusing            = true;
    }
Esempio n. 5
0
    public void StopFocusing()
    {
        iTween rotationAnimation = (iTween)this.gameObject.GetComponent <iTween>();

        rotationAnimation.time = 3f;
        _isFocusing            = false;
    }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
    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);
            }
        }
    }
Esempio n. 8
0
 // Update is called once per frame
 void Update()
 {
     if (PlayerStatus.playerStatus.lives <= 0)
     {
         itwen         = GetComponent <iTween>();
         itwen.enabled = false;
     }
 }
Esempio n. 9
0
        private void OnDestroy()
        {
            CleanRunData();
            cachePathTweenHashParam   = null;
            cacheBezierTweenHashParam = null;

            tween = null;
        }
Esempio n. 10
0
 // 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();
            }
        }
    }
Esempio n. 14
0
    /// <summary>
    /// iTweenの時のみ使用可能
    /// </summary>
    public void setMovingStop_iTween()
    {
        iTween thisiTween = this.gameObject.GetComponent <iTween> ();

        if (thisiTween != null)
        {
            thisiTween.isRunning = false;
        }
    }
Esempio n. 15
0
 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();
    }
Esempio n. 18
0
	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));
	}
Esempio n. 19
0
    private void OnEnable()
    {
        global::Debug.Log("============================= ITweenResumer was enabled");
        iTween component = base.gameObject.GetComponent <iTween>();

        if (component != null)
        {
            iTween.Resume(base.gameObject);
        }
    }
Esempio n. 20
0
    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;
            }
        }
Esempio n. 22
0
	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));
	}
Esempio n. 23
0
	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));
	}
Esempio n. 24
0
	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));
	}
Esempio n. 25
0
    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));
    }
Esempio n. 26
0
 public void OnPause()
 {
     pauseCanvas.SetActive(true);
     Common.isRunning = false;
     Time.timeScale   = 0;
     playerTween      = player.GetComponent <iTween>();
     if (playerTween != null)
     {
         playerTween.isRunning = false;
     }
 }
Esempio n. 27
0
	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);
    }
Esempio n. 29
0
    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;
    }
Esempio n. 30
0
 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> ();
     }
 }
Esempio n. 31
0
    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);
    }
Esempio n. 32
0
    public void ResetPosition()
    {
        iTween it = GetComponent <iTween> ();

        if (it != null)
        {
            iTween.Stop(gameObject);
        }
        Vector3 newPos = target.transform.localPosition;

        transform.localPosition = newPos;
    }
Esempio n. 33
0
	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));
	}
Esempio n. 34
0
	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));
	}
Esempio n. 35
0
	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));
	}
Esempio n. 36
0
	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;
        }
    }
Esempio n. 38
0
	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));
	}
Esempio n. 39
0
 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;
     }
 }
Esempio n. 40
0
        /// <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");
            }
        }
Esempio n. 41
0
 // 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;
         }
     }
 }
Esempio n. 42
0
	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));
    }
Esempio n. 44
0
    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));
    }
Esempio n. 45
0
 //値の変化を変える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
     ));
 }
Esempio n. 46
0
 override public void setEaseType(iTween.EaseType value)
 {
     m_easeType = value;
 }
Esempio n. 47
0
 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;
 }
Esempio n. 48
0
	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;
 }
Esempio n. 50
0
 // Use this for initialization
 void Start()
 {
     itwen = GetComponent<iTween>();
 }
Esempio n. 51
0
 public iTweener EaseType(iTween.EaseType easeType)
 {
     _easeType = easeType;
     return this;
 }
Esempio n. 52
0
 virtual public void setLoopType(iTween.LoopType value)
 {
     
 }
Esempio n. 53
0
 virtual public void setEaseType(iTween.EaseType value)
 {
     
 }
Esempio n. 54
0
    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");
    }
Esempio n. 55
0
 public iTweener LoopType( iTween.LoopType loopType )
 {
     _loopType = loopType;
     return this;
 }
Esempio n. 56
0
 override public void setLoopType(iTween.LoopType value)
 {
     m_loopType = value;
 }