Example #1
0
		/// <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;
		}
Example #2
0
		/// <summary>
		/// 移除移动对象
		/// </summary>
		public void RemoveMovingObject(Path.KeyframeList keyframeList)
		{
			_pairs.RemoveAll(item => item.keyframeList == keyframeList);
		}