锁定镜头修改

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":
{
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":
{

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace QFramework
@ -18,14 +19,14 @@ namespace QFramework
new SimpleObjectPool<CameraLockAction>(() => 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<string, string> 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;
}

View File

@ -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;
}