Bladeren bron

修改编辑器的相机事件,相机坐标支持x,y,z

大爷 1 jaar geleden
bovenliggende
commit
d9bb472865
2 gewijzigde bestanden met toevoegingen van 13 en 3 verwijderingen
  1. 5 1
      Common/CommonAI/Zone/Messages.cs
  2. 8 2
      Common/CommonAI/Zone/ZoneEditor/EventTrigger/Actions.Client.cs

+ 5 - 1
Common/CommonAI/Zone/Messages.cs

@@ -3019,11 +3019,13 @@ namespace CommonAI.Zone
         public int TimeMS = 0;
         public float x;
         public float y;
+        public float height;
         public CameraMoveToEvent() { }
-        public CameraMoveToEvent(float x, float y, float speed, int timeMS)
+        public CameraMoveToEvent(float x, float y, float height, float speed, int timeMS)
         {
             this.x = x;
             this.y = y;
+            this.height = height;
             this.MoveSpeedSec = speed;
             this.TimeMS = timeMS;
         }
@@ -3031,6 +3033,7 @@ namespace CommonAI.Zone
         {
             output.PutF32(x);
             output.PutF32(y);
+            output.PutF32(height);
             output.PutF32(MoveSpeedSec);
             output.PutS32(TimeMS);
         }
@@ -3038,6 +3041,7 @@ namespace CommonAI.Zone
         {
             this.x = input.GetF32();
             this.y = input.GetF32();
+            this.height = input.GetF32();
             this.MoveSpeedSec = input.GetF32();
             this.TimeMS = input.GetS32();
         }

+ 8 - 2
Common/CommonAI/Zone/ZoneEditor/EventTrigger/Actions.Client.cs

@@ -164,6 +164,9 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
         [DescAttribute("位置")]
         public PositionValue Position = new PositionValue.VALUE();
 
+        [DescAttribute("相机高度")]
+        public RealValue Height = new RealValue.VALUE();
+
         [DescAttribute("镜头移动速度(每秒距离)")]
         public float MoveSpeedSec = 1f;
 
@@ -176,7 +179,7 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
             Vector2 pos = Position.GetValue(api, args);
             if (pos != null)
             {
-               return new CameraMoveToEvent(pos.X, pos.Y, MoveSpeedSec, 0);
+               return new CameraMoveToEvent(pos.X, pos.Y, Height.GetValue(api,args), MoveSpeedSec, 0);
             }
             return null;
         }
@@ -187,6 +190,9 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
         [DescAttribute("位置")]
         public PositionValue Position = new PositionValue.VALUE();
 
+        [DescAttribute("相机高度")]
+        public RealValue Height = new RealValue.VALUE();
+
         [DescAttribute("镜头移动过去的总时间(毫秒)")]
         public IntegerValue TotalTimeMS = new IntegerValue.VALUE(1000);
 
@@ -200,7 +206,7 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
             int timeMS = TotalTimeMS.GetValue(api, args);
             if (pos != null)
             {
-                return new CameraMoveToEvent(pos.X, pos.Y, 0, timeMS);
+                return new CameraMoveToEvent(pos.X, pos.Y, Height.GetValue(api, args), 0, timeMS);
             }
             return null;
         }