锁定镜头修改

This commit is contained in:
shenjianxing 2025-01-09 15:06:14 +08:00
parent f5eb58cdc9
commit 0577053652
3 changed files with 9 additions and 16 deletions

View File

@ -157,8 +157,8 @@ public class ActionHelper
} }
case "CameraLock": case "CameraLock":
{ {
var strAction = (XMLTool.StringListAction)act; var strAction = (XMLTool.DictionaryAction)act;
return CameraLockAction.Allocate(strAction.args[0], strAction.args[1]); return CameraLockAction.Allocate(strAction.args);
} }
case "Video": case "Video":
{ {

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace QFramework namespace QFramework
@ -18,14 +19,14 @@ namespace QFramework
new SimpleObjectPool<CameraLockAction>(() => new CameraLockAction(), null, 10); new SimpleObjectPool<CameraLockAction>(() => new CameraLockAction(), null, 10);
string isMove; string isMove;
string isRotate; string isRotate;
public static CameraLockAction Allocate(string isMove, string isRotate, System.Action OnFinished = null) public static CameraLockAction Allocate(Dictionary<string, string> datas, System.Action OnFinished = null)
{ {
var retNode = mPool.Allocate(); var retNode = mPool.Allocate();
retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.ActionID = ActionKit.ID_GENERATOR++;
retNode.Deinited = false; retNode.Deinited = false;
retNode.Reset(); retNode.Reset();
retNode.isMove = isMove; retNode.isMove = datas.ContainsKey("isMove") ? datas["isMove"] : "true";
retNode.isRotate = isRotate; retNode.isRotate = datas.ContainsKey("isRotate") ? datas["isRotate"] : "true";
retNode.OnFinished = OnFinished; retNode.OnFinished = OnFinished;
return retNode; return retNode;
} }

View File

@ -676,24 +676,16 @@ namespace XMLTool
break; break;
case "CameraLock": case "CameraLock":
{ {
var act = new StringListAction(); var act = new DictionaryAction();
XAttribute isMove = action.Attribute("isMove"); XAttribute isMove = action.Attribute("isMove");
if (isMove != null) if (isMove != null)
{ {
act.args.Add(isMove.Value); act.args.Add("isMove", isMove.Value);
}
else
{
act.args.Add("true");
} }
XAttribute isRotate = action.Attribute("isRotate"); XAttribute isRotate = action.Attribute("isRotate");
if (isRotate != null) if (isRotate != null)
{ {
act.args.Add(isRotate.Value); act.args.Add("isRotate", isRotate.Value);
}
else
{
act.args.Add("true");
} }
newAction = act; newAction = act;
} }