public void EnterExcute() { curPos = soliderInfo.GetPosition(); targetPos = soliderInfo.GetBarrackPos(); speed = soliderInfo.GetSpeed(); //Debug.Log(curPos); //Debug.Log(targetPos); soliderInfo.Run(targetPos); }
public void EnterExcute() { curPos = soliderInfo.GetPosition(); targetPos = soliderInfo.GetBarrackPos(); speed = soliderInfo.GetSpeed(); if (targetPos.y > curPos.y && Math.Abs(targetPos.y - curPos.y) > Math.Abs(targetPos.x - curPos.x)) { soliderInfo.RunUp(); } else if (targetPos.x >= curPos.x) { soliderInfo.RunRight(); } else { soliderInfo.RunLeft(); } }