|
@@ -1,4 +1,5 @@
|
|
|
using UnityEngine;
|
|
|
+using UnityEngine.AI;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using Sfs2X.Entities.Data;
|
|
@@ -23,37 +24,20 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
|
|
|
public string nick;
|
|
|
|
|
|
- private LinkedList<AStarNode> path;
|
|
|
- private Vector3 nextMovePosition;
|
|
|
- private bool _isMoving;
|
|
|
+ private bool m_Moving;
|
|
|
public override bool isMoving
|
|
|
{
|
|
|
- get{return _isMoving;}
|
|
|
+ get{return m_Moving;}
|
|
|
}
|
|
|
- public AStarPoint targetMovePosition = new AStarPoint();
|
|
|
|
|
|
public bool forceMove;
|
|
|
|
|
|
- private float rotateSpeed = 200f;
|
|
|
- public float rotateTargetAngle;
|
|
|
- private bool _isTargetRotating;
|
|
|
-
|
|
|
- public float rotateMoveTargetAngle;
|
|
|
- private bool _isMoveRotating;
|
|
|
-
|
|
|
- public Transform bodyTrans;
|
|
|
- public Transform topPartTrans;
|
|
|
- public Transform bottomPartTrans;
|
|
|
-
|
|
|
- private Animation animationTop;
|
|
|
- private Animation animationBottom;
|
|
|
-
|
|
|
- public Material materialTop;
|
|
|
- public Material materialBottom;
|
|
|
+ private NavMeshAgent meshAgent;
|
|
|
+ public Vector3 moveDestination = Vector3.zero;
|
|
|
|
|
|
private PowerManager powerManager;
|
|
|
private SwapManager swapManager;
|
|
|
- private ShotManager shotManager;
|
|
|
+ private CraftModel craftModel;
|
|
|
|
|
|
public State state;
|
|
|
private CraftData craftData;
|
|
@@ -69,10 +53,10 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
public event EventUtil.SimpleEventDelegate OnSwapped;
|
|
|
public event EventUtil.SimpleEventDelegate OnCtrlChanged;
|
|
|
|
|
|
-
|
|
|
void Awake()
|
|
|
{
|
|
|
swapManager = new SwapManager(this);
|
|
|
+ meshAgent = GetComponent<NavMeshAgent> ();
|
|
|
}
|
|
|
|
|
|
public virtual void Init(Map map, CraftData craftData, CraftEquipModify equipModify)
|
|
@@ -98,26 +82,6 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
{
|
|
|
_originMaxHp = maxHp = craftData.GetMaxHp() + equipModify.hp;
|
|
|
|
|
|
- bodyTrans = transform.Find("Body");
|
|
|
-
|
|
|
- topPartTrans = bodyTrans.Find("Top");
|
|
|
- if(topPartTrans != null)
|
|
|
- {
|
|
|
- animationTop = topPartTrans.GetComponent<Animation>();
|
|
|
- materialTop = topPartTrans.GetComponentInChildren<Renderer>().material;
|
|
|
- material = materialTop;
|
|
|
- }
|
|
|
-
|
|
|
- bottomPartTrans = bodyTrans.Find("Bottom");
|
|
|
- if(bottomPartTrans != null)
|
|
|
- {
|
|
|
- animationBottom = bottomPartTrans.GetComponent<Animation>();
|
|
|
- materialBottom = bottomPartTrans.GetComponentInChildren<Renderer>().material;
|
|
|
- }
|
|
|
-
|
|
|
- if(topPartTrans == null)
|
|
|
- animation = bodyTrans.GetComponentInChildren<Animation>();
|
|
|
-
|
|
|
if(craftData != null)
|
|
|
{
|
|
|
if(powerManager == null)
|
|
@@ -126,11 +90,8 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
powerManager.UpdatePower(craftData.GetAttackId(), craftData.GetPowerIds());
|
|
|
team = craftData.team;
|
|
|
}
|
|
|
-
|
|
|
- shotManager = GetComponentInChildren<ShotManager>();
|
|
|
|
|
|
SetState (State.Idle);
|
|
|
-
|
|
|
Debuger.LogError (this.name+" maxhp "+maxHp+" damage "+GetDamage()+" mov "+moveSpeed);
|
|
|
}
|
|
|
|
|
@@ -162,27 +123,7 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
if(textureArr.Length > 0)
|
|
|
{
|
|
|
int index = value.GetHashCode() - 1;
|
|
|
- if(topPartTrans == null)
|
|
|
- {
|
|
|
- SkinnedMeshRenderer[] renderers = bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
|
- for(int i=0; i<renderers.Length; i++)
|
|
|
- {
|
|
|
- renderers[i].material.mainTexture = textureArr[index];
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SkinnedMeshRenderer[] renderers = topPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
|
- for(int i=0; i<renderers.Length; i++)
|
|
|
- {
|
|
|
- renderers[i].material.mainTexture = textureArr[index];
|
|
|
- }
|
|
|
- renderers = bottomPartTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
|
- for(int i=0; i<renderers.Length; i++)
|
|
|
- {
|
|
|
- renderers[i].material.mainTexture = textureArr[index];
|
|
|
- }
|
|
|
- }
|
|
|
+ craftModel.SetSkin(textureArr[index]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -194,7 +135,26 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
|
|
|
public ShotManager GetShotManager()
|
|
|
{
|
|
|
- return shotManager;
|
|
|
+ return craftModel.shotManager;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public CraftModel GetCraftModel()
|
|
|
+ {
|
|
|
+ return craftModel;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SetCraftModel(CraftModel craftModel)
|
|
|
+ {
|
|
|
+ if (this.craftModel != null) {
|
|
|
+ Destroy (this.craftModel.gameObject);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.craftModel = craftModel;
|
|
|
+ this.craftModel.transform.SetParent (this.transform);
|
|
|
+ this.craftModel.transform.localEulerAngles = Vector3.zero;
|
|
|
+ this.craftModel.transform.localPosition = Vector3.zero;
|
|
|
+ this.craftModel.transform.localScale = Vector3.one;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -259,13 +219,7 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
{
|
|
|
this.skinId = id;
|
|
|
if(texture != null)
|
|
|
- {
|
|
|
- SkinnedMeshRenderer[] rendererArr = bodyTrans.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
|
- for(int i=0; i<rendererArr.Length; i++)
|
|
|
- {
|
|
|
- rendererArr[i].material.mainTexture = texture;
|
|
|
- }
|
|
|
- }
|
|
|
+ craftModel.SetSkin (texture);
|
|
|
}
|
|
|
|
|
|
public int GetSkin()
|
|
@@ -297,79 +251,18 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
|
|
|
public override Transform GetBaseTransform()
|
|
|
{
|
|
|
- if(topPartTrans != null)
|
|
|
- return topPartTrans;
|
|
|
+ if(craftModel.topAnim != null)
|
|
|
+ return craftModel.topAnim.transform;
|
|
|
return transform;
|
|
|
}
|
|
|
|
|
|
public void SetState(State state)
|
|
|
{
|
|
|
- if(this.state != state)
|
|
|
- {
|
|
|
- this.state = state;
|
|
|
- string animName = state.ToString();
|
|
|
- if(animation != null)
|
|
|
- {
|
|
|
- if(animation.GetClip(animName) != null)
|
|
|
- animation.Play(animName);
|
|
|
- }
|
|
|
-
|
|
|
- if(animationTop == null)
|
|
|
- return;
|
|
|
-
|
|
|
- if(state == State.Idle)
|
|
|
- {
|
|
|
- if(animationTop.GetClip(animName) != null)
|
|
|
- {
|
|
|
- animationTop.Play(animName);
|
|
|
- animationBottom.Play(animName);
|
|
|
- }
|
|
|
- }
|
|
|
- else if(state == State.Run)
|
|
|
- {
|
|
|
- if(animationTop.GetClip(animName) != null)
|
|
|
- {
|
|
|
- animationTop.Play(animName);
|
|
|
- animationBottom.Play(animName);
|
|
|
- }
|
|
|
- }
|
|
|
- else if(state == State.Attack)
|
|
|
- {
|
|
|
- if(animationTop.GetClip(animName) != null)
|
|
|
- animationTop.Play(animName);
|
|
|
- if(isMoving)
|
|
|
- {
|
|
|
- if(animationBottom.GetClip(State.Run.ToString()) != null)
|
|
|
- animationBottom.Play(State.Run.ToString());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(animationBottom.GetClip(State.Idle.ToString()) != null)
|
|
|
- animationBottom.Play(State.Idle.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.state = state;
|
|
|
+ if (state == State.Attack)
|
|
|
+ craftModel.Attack ();
|
|
|
}
|
|
|
|
|
|
- public bool IsPlayingState(State state, Part part = Part.All)
|
|
|
- {
|
|
|
- string animName = state.ToString();
|
|
|
- if(animation != null)
|
|
|
- {
|
|
|
- return animation.IsPlaying(animName);
|
|
|
- }
|
|
|
-
|
|
|
- if(animationTop != null && (part == Part.Top || part == Part.All))
|
|
|
- {
|
|
|
- return animationTop.IsPlaying(animName);
|
|
|
- }
|
|
|
-
|
|
|
- if(animationBottom != null && (part == Part.Bottom || part == Part.All))
|
|
|
- {
|
|
|
- return animationBottom.IsPlaying(animName);
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
public void PositionTo(Vector3 position)
|
|
|
{
|
|
@@ -404,7 +297,7 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
if(!enableMove || holdAction)
|
|
|
return;
|
|
|
|
|
|
- StartMove(col, row);
|
|
|
+ StartMove(Map.GetCenterX(col), Map.GetCenterZ(row));
|
|
|
}
|
|
|
|
|
|
public void MoveTo(float x, float y)
|
|
@@ -414,43 +307,18 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
MoveTo(col, row);
|
|
|
}
|
|
|
|
|
|
- protected void StartMove(int col, int row)
|
|
|
+ protected void StartMove(float x, float y)
|
|
|
{
|
|
|
- targetMovePosition.x = col;
|
|
|
- targetMovePosition.y = row;
|
|
|
-
|
|
|
- Vector3 position = transform.position;
|
|
|
- int startCol = (int)(position.x/Map.TILE_WIDTH);
|
|
|
- int startRow = (int)(position.z/Map.TILE_LENGTH);
|
|
|
-
|
|
|
- map.PathSearchEnqueue(new AStarPoint(startCol, startRow), new AStarPoint(col, row), this);
|
|
|
+ moveDestination.Set (x, 0, y);
|
|
|
+ SetIsMoving(true);
|
|
|
+ OnMove();
|
|
|
+ swapManager.AbortSwap();
|
|
|
}
|
|
|
|
|
|
- public void SetPath(LinkedList<AStarNode> path)
|
|
|
+ private void SetIsMoving(bool value)
|
|
|
{
|
|
|
- //long startTime = System.DateTime.Now.ToFileTime();
|
|
|
- //path = map.GetPath(new AStarPoint(startCol, startRow), new AStarPoint(col, row), this);
|
|
|
- //long endTime = System.DateTime.Now.ToFileTime();
|
|
|
- //Debuger.Log("search path spend time : "+(endTime-startTime));
|
|
|
-
|
|
|
- this.path = path;
|
|
|
- if(!IsDead() && path != null)
|
|
|
- {
|
|
|
- path.RemoveFirst();
|
|
|
-
|
|
|
- _isMoving = true;
|
|
|
-
|
|
|
- if(state == State.Idle)
|
|
|
- SetState(State.Run);
|
|
|
-
|
|
|
- if(_teleportStep > 0)
|
|
|
- Teleport(_teleportStep);
|
|
|
- else
|
|
|
- setNextMovePosition();
|
|
|
-
|
|
|
- OnMove();
|
|
|
- swapManager.AbortSwap();
|
|
|
- }
|
|
|
+ m_Moving = value;
|
|
|
+ craftModel.moving = value;
|
|
|
}
|
|
|
|
|
|
public void StopMove()
|
|
@@ -463,9 +331,7 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
{
|
|
|
if(buffList[i].hasCloseTarget)
|
|
|
{
|
|
|
- int col = Map.XToColumn(target.position.x);
|
|
|
- int row = Map.ZToRow(target.position.z);
|
|
|
- StartMove(col, row);
|
|
|
+ StartMove(target.position.x, target.position.z);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -473,16 +339,13 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- path = null;
|
|
|
- _isMoving = false;
|
|
|
+ SetIsMoving (false);
|
|
|
forceMove = false;
|
|
|
-
|
|
|
- if(state == State.Run)
|
|
|
- SetState(State.Idle);
|
|
|
}
|
|
|
|
|
|
// Update is called once per frame
|
|
|
- void Update () {
|
|
|
+// public override void EnterFrame ()
|
|
|
+ void FixedUpdate () {
|
|
|
|
|
|
if(IsDead())
|
|
|
{
|
|
@@ -494,42 +357,20 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(_isMoving)
|
|
|
+ if(isMoving)
|
|
|
{
|
|
|
moving();
|
|
|
}
|
|
|
|
|
|
- if(target != null && target.CanShoot())
|
|
|
- {
|
|
|
- Vector3 targetPosition = target.position;
|
|
|
- float theta = NumberUtil.getRadianByATan(targetPosition.x, targetPosition.z, position.x, position.z);
|
|
|
- float rotateAngle = 90-NumberUtil.radianToAngle(theta);
|
|
|
- if(!rotateTargetAngle.Equals(rotateAngle))
|
|
|
- {
|
|
|
- rotateTargetAngle = rotateAngle;
|
|
|
- _isTargetRotating = true;
|
|
|
- }
|
|
|
+ if (target != null && target.CanShoot ()) {
|
|
|
+ craftModel.LookTo (target.position);
|
|
|
+ } else if(craftModel != null){
|
|
|
+ craftModel.LookToForward ();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- rotating();
|
|
|
CheckHpRecover();
|
|
|
DealBuff();
|
|
|
|
|
|
-
|
|
|
- if((state == State.Attack || state == State.Power) && !IsPlayingState(state, Part.Top))
|
|
|
- {
|
|
|
- if(isMoving)
|
|
|
- {
|
|
|
- SetState(State.Run);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SetState(State.Idle);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
if(swapManager.isPreparingSwap && !swapManager.requestedSwap)
|
|
|
{
|
|
|
headBar.SetSpellProgress(swapManager.GetPreparingSwapTime(), SwapManager.PREPARING_SWAP_DURATION);
|
|
@@ -538,189 +379,28 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
|
|
|
private void moving()
|
|
|
{
|
|
|
- float timeLeft = updateMovePosition(GameTime.deltaTime);
|
|
|
- if(_isMoving && timeLeft > 0)
|
|
|
- {
|
|
|
- updateMovePosition(timeLeft);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private float updateMovePosition(float deltaTime)
|
|
|
- {
|
|
|
- Vector3 position = transform.position;
|
|
|
-
|
|
|
- float deltaX = nextMovePosition.x-position.x;
|
|
|
- float deltaY = nextMovePosition.z-position.z;
|
|
|
- float theta = Mathf.Atan2(deltaY, deltaX);
|
|
|
-
|
|
|
- float distance = Mathf.Sqrt(deltaX*deltaX+deltaY*deltaY);
|
|
|
- float moveDistance = moveSpeed*deltaTime;
|
|
|
-
|
|
|
- float timeLeft = 0;
|
|
|
- if(moveDistance >= distance)
|
|
|
- {
|
|
|
- timeLeft = deltaTime*(1f-distance/moveDistance);
|
|
|
- DealMoveStepComplete();
|
|
|
- setNextMovePosition();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- float movX = moveDistance*Mathf.Cos(theta);
|
|
|
- float movZ = moveDistance*Mathf.Sin(theta);
|
|
|
-
|
|
|
- position.x += movX;
|
|
|
- position.z += movZ;
|
|
|
- transform.position = position;
|
|
|
- }
|
|
|
-
|
|
|
- return timeLeft;
|
|
|
- }
|
|
|
-
|
|
|
- private void DealMoveStepComplete()
|
|
|
- {
|
|
|
- Vector3 position = transform.position;
|
|
|
- position.x = nextMovePosition.x;
|
|
|
- position.z = nextMovePosition.z;
|
|
|
- transform.position = position;
|
|
|
- if(MoveStepComplete != null)
|
|
|
- MoveStepComplete();
|
|
|
- }
|
|
|
-
|
|
|
- private void setNextMovePosition()
|
|
|
- {
|
|
|
- if(path != null)
|
|
|
- {
|
|
|
- if(path.Count > 0)
|
|
|
- {
|
|
|
- AStarNode astarNode = path.First.Value;
|
|
|
- path.RemoveFirst();
|
|
|
-
|
|
|
- nextMovePosition = AstarNodeToPosition(astarNode);
|
|
|
-
|
|
|
- Vector3 position = transform.position;
|
|
|
-
|
|
|
- float theta = NumberUtil.getRadianByATan(nextMovePosition.x, nextMovePosition.z, position.x, position.z);
|
|
|
- float rotateAngle = 90-NumberUtil.radianToAngle(theta);
|
|
|
- Rotate (rotateAngle);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- StopMove();
|
|
|
- }
|
|
|
-
|
|
|
+ meshAgent.SetDestination (moveDestination);
|
|
|
+ if (meshAgent.remainingDistance > 0) {
|
|
|
if(miniCraft != null)
|
|
|
miniCraft.UpdatePos();
|
|
|
+ } else {
|
|
|
+ if (MoveStepComplete != null)
|
|
|
+ MoveStepComplete ();
|
|
|
+ StopMove ();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void Rotate(float rotateAngle)
|
|
|
- {
|
|
|
- rotateMoveTargetAngle = rotateAngle;
|
|
|
- _isMoveRotating = true;
|
|
|
-
|
|
|
- if(target == null)
|
|
|
- {
|
|
|
- if(!rotateTargetAngle.Equals(rotateMoveTargetAngle))
|
|
|
- {
|
|
|
- rotateTargetAngle = rotateMoveTargetAngle;
|
|
|
- _isTargetRotating = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private Vector3 AstarNodeToPosition(AStarNode astarNode)
|
|
|
- {
|
|
|
- return new Vector3((astarNode.X+0.5f)*Map.TILE_WIDTH, 0, (astarNode.Y+0.5f)*Map.TILE_LENGTH);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- public void setRotateTargetAngle(float value)
|
|
|
+ public void SetRotateTargetAngle(float angle)
|
|
|
{
|
|
|
- rotateTargetAngle = value;
|
|
|
- _isTargetRotating = true;
|
|
|
- }
|
|
|
-
|
|
|
- private void rotating()
|
|
|
- {
|
|
|
- if(!enableMove || swapManager.isPreparingSwap)
|
|
|
- return;
|
|
|
-
|
|
|
- if(bottomPartTrans == null)
|
|
|
- {
|
|
|
- if(_isMoveRotating || _isTargetRotating)
|
|
|
- {
|
|
|
- float targetRotation = 0;
|
|
|
- if(_isMoving)
|
|
|
- {
|
|
|
- targetRotation = rotateMoveTargetAngle;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- targetRotation = rotateTargetAngle;
|
|
|
- }
|
|
|
-
|
|
|
- Vector3 eulerAngles = bodyTrans.eulerAngles;
|
|
|
- float currentRotation = eulerAngles.y;
|
|
|
- float rotateStep = rotateSpeed*GameTime.deltaTime;
|
|
|
-
|
|
|
- currentRotation = NumberUtil.getCloseToTargetAngle(currentRotation, targetRotation, rotateStep);
|
|
|
- eulerAngles.y = currentRotation;
|
|
|
- bodyTrans.eulerAngles = eulerAngles;
|
|
|
-
|
|
|
- if(_isMoving)
|
|
|
- {
|
|
|
- if(rotateMoveTargetAngle.Equals(currentRotation))
|
|
|
- {
|
|
|
- _isMoveRotating = false;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(rotateTargetAngle.Equals(currentRotation))
|
|
|
- {
|
|
|
- _isTargetRotating = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Vector3 eulerAngles;
|
|
|
- float rotateStep = rotateSpeed*GameTime.deltaTime;
|
|
|
-
|
|
|
- if(_isTargetRotating)
|
|
|
- {
|
|
|
- eulerAngles = topPartTrans.localEulerAngles;
|
|
|
- float currentRotation = eulerAngles.y;
|
|
|
-
|
|
|
- currentRotation = NumberUtil.getCloseToTargetAngle(currentRotation, rotateTargetAngle, rotateStep);
|
|
|
- eulerAngles.y = currentRotation;
|
|
|
- topPartTrans.localEulerAngles = eulerAngles;
|
|
|
- if(shotManager != null)
|
|
|
- shotManager.transform.localEulerAngles = eulerAngles;
|
|
|
- if(rotateTargetAngle.Equals(currentRotation))
|
|
|
- {
|
|
|
- _isTargetRotating = false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(_isMoveRotating)
|
|
|
- {
|
|
|
- eulerAngles = bottomPartTrans.localEulerAngles;
|
|
|
- float currentBottomRotation = eulerAngles.y;
|
|
|
-
|
|
|
- currentBottomRotation = NumberUtil.getCloseToTargetAngle(currentBottomRotation, rotateMoveTargetAngle, rotateStep);
|
|
|
-
|
|
|
- eulerAngles.y = currentBottomRotation;
|
|
|
- bottomPartTrans.localEulerAngles = eulerAngles;
|
|
|
- if(rotateMoveTargetAngle.Equals(currentBottomRotation))
|
|
|
- {
|
|
|
- _isMoveRotating = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ Vector3 targetPos = transform.position;
|
|
|
+ float radian = angle * Mathf.Deg2Rad;
|
|
|
+ float x = Mathf.Cos (radian);
|
|
|
+ float y = Mathf.Sin (radian);
|
|
|
+ targetPos.x += x;
|
|
|
+ targetPos.z += y;
|
|
|
+ craftModel.LookAt (targetPos);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -739,14 +419,14 @@ public class Craft : BattleObject, IPowerOwner
|
|
|
|
|
|
for(int i=0; i<step; i++)
|
|
|
{
|
|
|
- setNextMovePosition();
|
|
|
+// setNextMovePosition();
|
|
|
if(!isMoving)
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- DealMoveStepComplete();
|
|
|
+// DealMoveStepComplete();
|
|
|
|
|
|
_teleportStep = 0;
|
|
|
|