void IBattleCharacter.MoveTo(UVector3 position) { if (!Agent || !Agent.enabled) { return; } IsStop = false; this.Agent.Resume(); var pos = position.ToUVer3(); UnityEngine.AI.NavMeshHit hit; if (UnityEngine.AI.NavMesh.SamplePosition(pos, out hit, 10000, this.Agent.areaMask)) { targetPos = hit.position; } else { return; } if (Vector3.Distance(targetPos.Value, this.transform.position) < 0.2f) { stopMove(); return; } this.Agent.SetDestination(targetPos.Value); }
void IBattleCharacter.SetPosition(UVector3 pos) { this.transform.localPosition = pos.ToUVer3(); }
void IBattleCharacter.SetForward(UVector3 forward) { this.transform.forward = forward.ToUVer3(); }