public override void OnEnter() { Vector2Int startPos = Routine.First(); Vector2Int endPos = Routine.Last(); Assert.IsFalse(startPos == endPos, "移动点和终结点相同"); RPGCharacter ch = null; if (CharacterID >= 0) { ch = gameMode.ChapterManager.GetCharacterFromID(CharacterID); Assert.IsNotNull(ch, startPos + "处不存在角色"); var chPos = ch.GetTileCoord(); Assert.IsTrue(startPos == chPos, "ID:" + CharacterID + " 移动起始点" + startPos + "与角色所在位置" + chPos + "不相符"); } else { ch = gameMode.ChapterManager.GetCharacterFromCoord(startPos); Assert.IsNotNull(ch, startPos + "处不存在角色"); } ch.Logic.SetTileCoord(endPos); if (CameraFollow) { gameMode.slgCamera.StartFollowTransform(ch.GetTransform(), true); } if (WaitUntilFinished) { gameMode.BattlePlayer.MoveUnitByRoutine(Routine, ConstTable.UNIT_MOVE_SPEED(Speed), Continue); } else { gameMode.BattlePlayer.MoveUnitByRoutine(Routine, ConstTable.UNIT_MOVE_SPEED(Speed), null); Continue(); } }
protected void CameraFollow() { gameMode.slgCamera.StartFollowTransform(unit.GetTransform(), true); }