diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index 813c31c2..aa776072 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -157,8 +157,8 @@ public class ActionHelper } case "CameraLock": { - var strAction = (XMLTool.StringListAction)act; - return CameraLockAction.Allocate(strAction.args[0], strAction.args[1]); + var strAction = (XMLTool.DictionaryAction)act; + return CameraLockAction.Allocate(strAction.args); } case "Video": { diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index 4cf89710..dedeaf82 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -83,6 +83,10 @@ namespace QFramework } anim[animName].speed = curSpeed; anim.Play(animName); + if (anim[animName].wrapMode== WrapMode.Loop) + { + this.Finish(); + } } } catch (Exception) diff --git a/Assets/Scripts/Actions/CameraLockAction.cs b/Assets/Scripts/Actions/CameraLockAction.cs index 5a2d87bc..2dd41eae 100644 --- a/Assets/Scripts/Actions/CameraLockAction.cs +++ b/Assets/Scripts/Actions/CameraLockAction.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using UnityEngine; namespace QFramework @@ -18,14 +19,14 @@ namespace QFramework new SimpleObjectPool(() => new CameraLockAction(), null, 10); string isMove; string isRotate; - public static CameraLockAction Allocate(string isMove, string isRotate, System.Action OnFinished = null) + public static CameraLockAction Allocate(Dictionary datas, System.Action OnFinished = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.Deinited = false; retNode.Reset(); - retNode.isMove = isMove; - retNode.isRotate = isRotate; + retNode.isMove = datas.ContainsKey("isMove") ? datas["isMove"] : "true"; + retNode.isRotate = datas.ContainsKey("isRotate") ? datas["isRotate"] : "true"; retNode.OnFinished = OnFinished; return retNode; } diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index c72821f9..970508a6 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -676,24 +676,16 @@ namespace XMLTool break; case "CameraLock": { - var act = new StringListAction(); + var act = new DictionaryAction(); XAttribute isMove = action.Attribute("isMove"); if (isMove != null) { - act.args.Add(isMove.Value); - } - else - { - act.args.Add("true"); + act.args.Add("isMove", isMove.Value); } XAttribute isRotate = action.Attribute("isRotate"); if (isRotate != null) { - act.args.Add(isRotate.Value); - } - else - { - act.args.Add("true"); + act.args.Add("isRotate", isRotate.Value); } newAction = act; } diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml index 9404bb72..72f8b05e 100644 --- a/Doc/Xml配置文档.xml +++ b/Doc/Xml配置文档.xml @@ -51,13 +51,12 @@ - + - - + + @@ -128,7 +127,7 @@