Forráskód Böngészése

增加单位传送时,支持改变朝向

大爷 1 éve
szülő
commit
1f2f7afbb9

+ 1 - 1
Common/CommonAI/Zone/Instance/InstanceUnit.cs

@@ -1217,7 +1217,7 @@ namespace CommonAI.Zone.Instance
             setPos(x, y);
             if (setDirction)
             {
-                this.faceTo(direction);
+                this.Direction = direction;
             }
             SendForceSync();
 

+ 11 - 1
Common/CommonAI/Zone/ZoneEditor/EventTrigger/Actions.Units.cs

@@ -648,6 +648,9 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
         [DescAttribute("位置")]
         public PositionValue Pos = new PositionValue.VALUE();
 
+        [DescAttribute("改变朝向")]
+        public float Direction = 0f;
+
         public override string ToString()
         {
             return string.Format("{0}传送到{1}", Unit, Pos);
@@ -658,7 +661,14 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
             Vector2 pos = Pos.GetValue(api, args);
             if(unit != null && pos != null)
             {
-                unit.transport(pos.X, pos.Y);
+                if (Math.Abs(Direction) < 0.001f)
+                {
+                    unit.transport(pos.X, pos.Y);
+                }
+                else
+                {
+                    unit.transport(pos.X, pos.Y, true, Direction);
+                }
             }
         }
     }