Пример #1
0
		public iTweenSimplePlayer(MonoBehaviour owner, float delay, float time, 
			iTweenSimple.LoopType type, 
			System.Action<float> whenUpdate, 
			System.Action whenRestart, 
			System.Action<bool> whenFinish)
		{
			this.Play(owner, delay, time, type, whenUpdate, whenRestart, whenFinish);
		}
		public void Play(float delay, float time, 
			iTweenSimple.LoopType type, 
			System.Action<float> whenUpdate, 
			System.Action whenRestart, 
			System.Action<bool> whenFinish)
		{
			this.tweener.Play(this, delay, time, false, type, 
				whenUpdate, whenRestart, whenFinish);
		}
Пример #3
0
		public void Play(MonoBehaviour owner, float delay, float time, bool enableCoroutine, 
			iTweenSimple.LoopType type, 
			System.Action<float> whenUpdate, 
			System.Action whenRestart, 
			System.Action<bool> whenFinish)
		{
			this.owner = owner;
			this.runDelay = true;
			
			this.playStartTime = Time.time;
			this.DelayTime = delay < 0 ? 0 : delay;
			this.whenIncompleteFinish = whenFinish;
			
			this.tweener.to(time, type, delegate(float percentage){
				
				if (whenUpdate != null)
					whenUpdate(percentage);
				
			}, delegate(){
				
				this.runDelay = true;
				
				if (whenRestart != null)
					whenRestart();
				
			}, delegate(){

				if (whenFinish != null)
					whenFinish(true);
			});
			
			if (this.CoroutineEnabled = enableCoroutine)
			{
				this.owner.StopCoroutine("PlayTween");
				this.owner.StartCoroutine(this.PlayTween());
			}
		}