|
@@ -234,33 +234,48 @@ namespace XmdsCommon.EditorData
|
|
|
public UnitSnapData() { }
|
|
|
public UnitSnapData(SceneData src)
|
|
|
{
|
|
|
- //单位信息
|
|
|
- foreach (var unit in src.Units)
|
|
|
+ List<SceneObjectData> allList = new List<SceneObjectData>();
|
|
|
+ allList.AddRange(src.Points);
|
|
|
+ allList.AddRange(src.Regions);
|
|
|
+ allList.AddRange(src.Decorations);
|
|
|
+ allList.AddRange(src.Units);
|
|
|
+ allList.AddRange(src.Items);
|
|
|
+ allList.AddRange(src.Areas);
|
|
|
+
|
|
|
+ //单位信息
|
|
|
+ foreach (var unit in allList)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- UnitSnapDataItem rgs = new UnitSnapDataItem();
|
|
|
- rgs.unitID = unit.UnitTemplateID;
|
|
|
- rgs.unitName = unit.Name;
|
|
|
- rgs.x = unit.X;
|
|
|
- rgs.y = unit.Y;
|
|
|
- rgs.mapShow = unit.MapShow;
|
|
|
- rgs.unitMName = unit.UnitName;
|
|
|
- rgs.unitMIcon = unit.UnitIcon;
|
|
|
- rgs.offsetX = unit.OffsetX;
|
|
|
- rgs.offsetY = unit.OffsetY;
|
|
|
- rgs.lableOffsetX = unit.LableOffsetX;
|
|
|
- rgs.lableOffsetY = unit.LableOffsetY;
|
|
|
- this.units.Add(rgs);
|
|
|
+ if (unit.MapShow)
|
|
|
+ {
|
|
|
+ UnitSnapDataItem rgs = new UnitSnapDataItem();
|
|
|
+ rgs.unitName = unit.Name;
|
|
|
+ rgs.x = unit.X;
|
|
|
+ rgs.y = unit.Y;
|
|
|
+ rgs.mapShow = unit.MapShow;
|
|
|
+ rgs.unitMName = unit.UnitName;
|
|
|
+ rgs.unitMIcon = unit.UnitIcon;
|
|
|
+ rgs.offsetX = unit.OffsetX;
|
|
|
+ rgs.offsetY = unit.OffsetY;
|
|
|
+ rgs.lableOffsetX = unit.LableOffsetX;
|
|
|
+ rgs.lableOffsetY = unit.LableOffsetY;
|
|
|
+ rgs.lableColor = unit.LableColor;
|
|
|
+ rgs.lableSize = unit.LableSize;
|
|
|
+ rgs.lableOutLine = unit.LableOutline;
|
|
|
+ this.units.Add(rgs);
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception err)
|
|
|
{
|
|
|
throw new Exception(string.Format("parse snap unit data error : scene={0} region={1}", src, unit.Name), err);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // 路点信息
|
|
|
- foreach (var point in src.Points)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 路点信息
|
|
|
+ foreach (var point in src.Points)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -296,7 +311,6 @@ namespace XmdsCommon.EditorData
|
|
|
public class UnitSnapDataItem : IExternalizable
|
|
|
{
|
|
|
public String unitName;
|
|
|
- public int unitID;
|
|
|
public float x, y;
|
|
|
public bool mapShow;
|
|
|
public String unitMName;
|
|
@@ -305,11 +319,13 @@ namespace XmdsCommon.EditorData
|
|
|
public float offsetY;
|
|
|
public float lableOffsetX;
|
|
|
public float lableOffsetY;
|
|
|
+ public int lableColor;
|
|
|
+ public int lableSize;
|
|
|
+ public bool lableOutLine;
|
|
|
|
|
|
public void ReadExternal(IInputStream input)
|
|
|
{
|
|
|
this.unitName = input.GetUTF();
|
|
|
- this.unitID = input.GetS32();
|
|
|
this.x = input.GetF32();
|
|
|
this.y = input.GetF32();
|
|
|
this.mapShow = input.GetBool();
|
|
@@ -318,12 +334,14 @@ namespace XmdsCommon.EditorData
|
|
|
this.offsetX = input.GetF32();
|
|
|
this.offsetY = input.GetF32();
|
|
|
this.lableOffsetX = input.GetF32();
|
|
|
- this.lableOffsetY = input.GetF32();
|
|
|
+ this.lableOffsetY = input.GetF32();
|
|
|
+ this.lableColor = input.GetS32();
|
|
|
+ this.lableSize = input.GetS32();
|
|
|
+ this.lableOutLine = input.GetBool();
|
|
|
}
|
|
|
public void WriteExternal(IOutputStream output)
|
|
|
{
|
|
|
output.PutUTF(this.unitName);
|
|
|
- output.PutS32(this.unitID);
|
|
|
output.PutF32(this.x);
|
|
|
output.PutF32(this.y);
|
|
|
output.PutBool(this.mapShow);
|
|
@@ -332,7 +350,10 @@ namespace XmdsCommon.EditorData
|
|
|
output.PutF32(this.offsetX);
|
|
|
output.PutF32(this.offsetY);
|
|
|
output.PutF32(this.lableOffsetX);
|
|
|
- output.PutF32(this.lableOffsetY);
|
|
|
+ output.PutF32(this.lableOffsetY);
|
|
|
+ output.PutS32(this.lableColor);
|
|
|
+ output.PutS32(this.lableSize);
|
|
|
+ output.PutBool(this.lableOutLine);
|
|
|
}
|
|
|
}
|
|
|
|