public void Move(MotionScript motionObject) { if (motionObject.IsFinished && IsAbleToMove()) { m_currentMotion = null; var toPosition = m_tile.GetNextPosition(); toPosition.y += Next.Height; motionObject.StartMotion(toPosition, Speed); Next.HoldMotion(motionObject); } }
private void Update() { if (m_currentMotion != null) { if (m_currentMotion.IsFinished) { var getter = GetterObject; IMover getterMover = getter?.GetComponent <IMover>(); if (getterMover?.IsFree() ?? false) { getterMover.HoldMotion(m_currentMotion); m_currentMotion = null; } } } }