/// <summary> /// 添加移动对象. 物体移动中会计算路径关键帧插值并应用到目标组件上 /// </summary> public bool AddMovingObject(Path.KeyframeList keyframeList, Component target) { if (_path && keyframeList && target && keyframeList.path == _path && keyframeList.targetComponentType.IsInstanceOfType(target) && !_pairs.Exists(item => item.keyframeList == keyframeList)) { var movingObject = new KeyframeListTargetComponentPair(); movingObject.keyframeList = keyframeList; movingObject.targetComponent = target; _pairs.Add(movingObject); return true; } else return false; }
/// <summary> /// 更新移动对象, 由 MoveAlongPath 调用 /// </summary> public abstract void UpdateMovingObject(KeyframeListTargetComponentPair pair, MoveAlongPath movingObject);