// try to use UniRx when have time	
	public IEnumerator Move(Vector3 currentPoint, Vector3 endPoint, MoveStyle move){
		float time = 0;
		const float totalTime = .3f;
		
		//onAction = true;
		while (time < totalTime)
		{
			float x = Mathf.Lerp(currentPoint.x, endPoint.x, time / totalTime);
			float y = Mathf.Lerp(currentPoint.y, endPoint.y, time / totalTime);
			
			y -= 18;
			
			transform.position = new Vector3(x, y);
			time += Time.deltaTime;
		}
		
		//this._State = PlayerState.ATTACK;
		//Debug.Log ("After Move: " + this._State);
		yield return null;
		
		if(move == MoveStyle.SLOW)
			yield return new WaitForSeconds(0.3f);
		
		else if(move == MoveStyle.NORMAL)
			yield return new WaitForSeconds(0.1f);
		
		else if(move == MoveStyle.FAST)
			yield return new WaitForSeconds(0.05f);
		
		else
			yield return new WaitForSeconds(0.4f);
	}
 private void Reset()
 {
     FollowingStyle = MoveStyle.Loose;
     Tracking       = TrackingStyle.AimingAverage;
     TrackDistance  = 2f;
     TrackSpeed     = 5f;
     Offset         = new Vector3(0.5f, 10.0f, -0.5f);
 }
	//public int[] HealthHistory = new int[50];
	
	public PlayList(FlatHexPoint savePointLocation, MoveStyle saveMove, ActionStyle saveAction, EntityViewModel saveEnemyVM, EntityView saveEnemyView)
	{
		this.SavePointLocation = savePointLocation;
		this.SaveMove = saveMove;
		this.SaveAction = saveAction;
		this.SaveEnemyVM = saveEnemyVM;
		this.SaveEnemyView = saveEnemyView;
		//this.HealthHistory = healthHistory;
	}
示例#4
0
 void Reset()
 {
     FollowingStyle = MoveStyle.Loose;
     Tracking       = TrackingStyle.AimingAverage;
     TrackDistance  = 2f;
     TrackSpeed     = 5f;
     Offset         = new Vector3(0.5f, 10.0f, -0.5f);
     Targets        = new List <GameObject>();
 }