我正在使用名为“Movement Animset Pro v1.693.unitypackage”的统一包来移动统一角色,当我以统一方式导入包时,除了脚本文件之外,它所有的代码都很好,但我正在使用最后一个代码统一版本,这是代码// (c) 版权所有 HutongGames, LLC 2010-2011。版权所有。 using UnityEngine; namespace HutongGames.PlayMaker.Actions {[ActionCategory(ActionCategory.Transform)][Tooltip("Moves a Game Object towards a Target. Optionally sends an event when successful. Optionally set when to update, during regular update, lateUpdate or FixedUpdate. The Target can be specified as a Game Object or a world Position. If you specify both, then the Position is used as a local offset from the Object's Position.")]public class MoveTowards2 : FsmStateAction{ public enum UpdateType {Update,LateUpdate,FixedUpdate}; [RequiredField] public FsmOwnerDefault gameObject; public FsmGameObject targetObject; public FsmVector3 targetPosition; public FsmBool ignoreVertical; [HasFloatSlider(0, 20)] public FsmFloat maxSpeed; [HasFloatSlider(0, 5)] public FsmFloat finishDistance; public FsmEvent finishEvent; public UpdateType updateType; public override void Reset() { gameObject = null; targetObject = null; maxSpeed = 10f; finishDistance = 1f; finishEvent = null; updateType = UpdateType.Update; } public override void OnUpdate() { if (updateType == UpdateType.Update) { DoMoveTowards(); } } public override void OnLateUpdate() { if (updateType == UpdateType.LateUpdate) { DoMoveTowards(); } } public override void OnFixedUpdate() { //if (updateType == UpdateType.FixedUpdate) //{ DoMoveTowards(); //} } void DoMoveTowards() { var go = Fsm.GetOwnerDefaultTarget(gameObject); if (go == null) { return; } var goTarget = targetObject.Value; if (goTarget == null && targetPosition.IsNone) { return; }
1 回答
桃花长相依
TA贡献1860条经验 获得超8个赞
由于错误表明程序找不到像“FsmStateAction”这样的名称,请查看该名称的资产并找到包含它的脚本,然后将脚本的命名空间放在代码的顶部,例如:
using someNamespace;
我可以看到你有一些覆盖错误,如果它们不是虚拟的,你不能覆盖这些方法,在你自己制作之前检查包的代码。
- 1 回答
- 0 关注
- 85 浏览
添加回答
举报
0/150
提交
取消