提交 cb9c557e 编写于 作者: T tanghai

服务端recast寻路,带一个状态同步的demo

上级 6a5bd3db
......@@ -38,7 +38,7 @@
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">tanghai</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/APPLY_ON_COMPLETION/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ThisQualifier/INSTANCE_MEMBERS_QUALIFY_MEMBERS/@EntryValue">All</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_FIRST_ARG_BY_PAREN/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_FIRST_ARG_BY_PAREN/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/CONTINUOUS_INDENT_MULTIPLIER/@EntryValue">2</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_ATTRIBUTE_STYLE/@EntryValue">JOIN</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FIXED_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
......@@ -47,13 +47,19 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_METHOD_DECL_PARS/@EntryValue">NONE</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_EXPR_MEMBER_ARRANGEMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_INITIALIZER_ARRANGEMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_USER_LINEBREAKS/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_INVOCATION_PARENS_ARRANGEMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_USER_LINEBREAKS/@EntryValue">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/MAX_ENUM_MEMBERS_ON_LINE/@EntryValue">1</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/MODIFIERS_ORDER/@EntryValue">private public protected internal new abstract virtual override sealed static readonly extern unsafe volatile async</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_EXPR_ACCESSOR_ON_SINGLE_LINE/@EntryValue">ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_EXPR_METHOD_ON_SINGLE_LINE/@EntryValue">ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_EXPR_PROPERTY_ON_SINGLE_LINE/@EntryValue">ALWAYS</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
......@@ -66,11 +72,12 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TERNARY_QUEST/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_FOR_STMT_HEADER_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">150</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_DECLARATION_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_TYPE_PARAMEER_CONSTRAINTS_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
......
syntax = "proto3";
package ETModel;
message OneFrameMessage // IActorLocationMessage
{
int32 RpcId = 90;
int64 ActorId = 93;
int32 Op = 1;
bytes AMessage = 2;
}
message FrameMessage // IActorMessage
{
int32 RpcId = 90;
int64 ActorId = 93;
int32 Frame = 1;
repeated OneFrameMessage Message = 2;
}
......@@ -239,8 +239,10 @@
int32 Error = 91;
string Message = 92;
// 自己的unit id
int64 UnitId = 1;
int Count = 2;
// 所有的unit
repeated UnitInfo Units = 2;
}
message G2M_SessionDisconnect // IActorLocationMessage
......
......@@ -47,15 +47,19 @@ message G2C_EnterMap // IResponse
int32 RpcId = 90;
int32 Error = 91;
string Message = 92;
// 自己的unit id
int64 UnitId = 1;
int32 Count = 2;
// 所有的unit
repeated UnitInfo Units = 2;
}
message UnitInfo
{
int64 UnitId = 1;
int32 X = 2;
int32 Z = 3;
float X = 2;
float Y = 3;
float Z = 4;
}
message Actor_CreateUnits // IActorMessage
......@@ -65,12 +69,30 @@ message Actor_CreateUnits // IActorMessage
repeated UnitInfo Units = 1;
}
message Frame_ClickMap // IFrameMessage
message Frame_ClickMap // IActorLocationMessage
{
int32 RpcId = 90;
int64 ActorId = 93;
int64 Id = 94;
int32 X = 1;
int32 Z = 2;
float X = 1;
float Y = 2;
float Z = 3;
}
message M2C_PathfindingResult // IActorMessage
{
int64 ActorId = 93;
int64 Id = 1;
float X = 2;
float Y = 3;
float Z = 4;
repeated float Xs = 5;
repeated float Ys = 6;
repeated float Zs = 7;
}
......
......@@ -4,6 +4,9 @@ using System.Net;
using System.Threading;
using ETModel;
using NLog;
using PF;
using ABPath = ETModel.ABPath;
using Path = System.IO.Path;
namespace App
{
......@@ -80,7 +83,7 @@ namespace App
Game.Scene.AddComponent<ActorMessageSenderComponent>();
Game.Scene.AddComponent<ActorLocationSenderComponent>();
Game.Scene.AddComponent<ActorMessageDispatherComponent>();
Game.Scene.AddComponent<ServerFrameComponent>();
Game.Scene.AddComponent<PathfindingComponent>();
break;
case AppType.AllServer:
Game.Scene.AddComponent<ActorMessageSenderComponent>();
......@@ -99,7 +102,8 @@ namespace App
Game.Scene.AddComponent<RealmGateAddressComponent>();
Game.Scene.AddComponent<GateSessionKeyComponent>();
Game.Scene.AddComponent<ConfigComponent>();
Game.Scene.AddComponent<ServerFrameComponent>();
//Game.Scene.AddComponent<ServerFrameComponent>();
Game.Scene.AddComponent<PathfindingComponent>();
// Game.Scene.AddComponent<HttpComponent>();
break;
case AppType.Benchmark:
......@@ -116,7 +120,7 @@ namespace App
default:
throw new Exception($"命令行参数没有设置正确的AppType: {startConfig.AppType}");
}
while (true)
{
try
......
......@@ -19,7 +19,6 @@ namespace ETHotfix
M2G_CreateUnit createUnit = (M2G_CreateUnit)await mapSession.Call(new G2M_CreateUnit() { PlayerId = player.Id, GateSessionId = session.InstanceId });
player.UnitId = createUnit.UnitId;
response.UnitId = createUnit.UnitId;
response.Count = createUnit.Count;
reply(response);
}
catch (Exception e)
......
using ETModel;
using PF;
using ABPath = ETModel.ABPath;
namespace ETHotfix
{
[ActorMessageHandler(AppType.Map)]
public class Frame_ClickMapHandler : AMActorLocationHandler<Unit, Frame_ClickMap>
{
protected override void Run(Unit unit, Frame_ClickMap message)
{
Vector3 target = new Vector3(message.X, message.Y, message.Z);
unit.GetComponent<UnitPathComponent>().MoveTo(target);
}
}
}
\ No newline at end of file
using System;
using ETModel;
using Google.Protobuf;
using PF;
namespace ETHotfix
{
......@@ -12,26 +12,33 @@ namespace ETHotfix
M2G_CreateUnit response = new M2G_CreateUnit();
try
{
Unit unit = ComponentFactory.Create<Unit>();
Unit unit = ComponentFactory.CreateWithId<Unit>(IdGenerater.GenerateId());
unit.AddComponent<MoveComponent>();
unit.AddComponent<UnitPathComponent>();
unit.Position = new Vector3(-10, 0, -10);
await unit.AddComponent<MailBoxComponent>().AddLocation();
unit.AddComponent<UnitGateComponent, long>(message.GateSessionId);
Game.Scene.GetComponent<UnitComponent>().Add(unit);
response.UnitId = unit.Id;
response.Count = Game.Scene.GetComponent<UnitComponent>().Count;
reply(response);
if (response.Count == 2)
// 广播创建的unit
Actor_CreateUnits createUnits = new Actor_CreateUnits();
Unit[] units = Game.Scene.GetComponent<UnitComponent>().GetAll();
foreach (Unit u in units)
{
Actor_CreateUnits actorCreateUnits = new Actor_CreateUnits();
Unit[] units = Game.Scene.GetComponent<UnitComponent>().GetAll();
foreach (Unit u in units)
{
actorCreateUnits.Units.Add(new UnitInfo() {UnitId = u.Id, X = (int)(u.Position.X * 1000), Z = (int)(u.Position.Z * 1000) });
}
MessageHelper.Broadcast(actorCreateUnits);
UnitInfo unitInfo = new UnitInfo();
unitInfo.X = u.Position.x;
unitInfo.Y = u.Position.y;
unitInfo.Z = u.Position.z;
unitInfo.UnitId = u.Id;
createUnits.Units.Add(unitInfo);
}
MessageHelper.Broadcast(createUnits);
reply(response);
}
catch (Exception e)
{
......
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ETModel;
using PF;
namespace ETHotfix
{
public static class UnitPathComponentHelper
{
public static async Task MoveAsync(this UnitPathComponent self, List<Vector3> path)
{
if (path.Count == 0)
{
return;
}
// 第一个点是unit的当前位置,所以不用发送
for (int i = 1; i < path.Count; ++i)
{
// 每移动3个点发送下3个点给客户端
if (i % 3 == 1)
{
self.BroadcastPath(path, i, 3);
}
Vector3 v3 = path[i];
await self.Entity.GetComponent<MoveComponent>().MoveToAsync(v3, self.CancellationTokenSource.Token);
}
}
public static async void MoveTo(this UnitPathComponent self, Vector3 target)
{
if ((self.Target - target).magnitude < 0.1f)
{
return;
}
self.Target = target;
Unit unit = self.GetParent<Unit>();
PathfindingComponent pathfindingComponent = Game.Scene.GetComponent<PathfindingComponent>();
self.ABPath = ComponentFactory.Create<ETModel.ABPath, Vector3, Vector3>(unit.Position,
new Vector3(target.x, target.y, target.z));
pathfindingComponent.Search(self.ABPath);
Log.Debug($"find result: {self.ABPath.Result.ListToString()}");
self.CancellationTokenSource?.Cancel();
self.CancellationTokenSource = new CancellationTokenSource();
await self.MoveAsync(self.ABPath.Result);
self.CancellationTokenSource.Dispose();
self.CancellationTokenSource = null;
}
// 从index找接下来3个点,广播
public static void BroadcastPath(this UnitPathComponent self, List<Vector3> path, int index, int offset)
{
Unit unit = self.GetParent<Unit>();
Vector3 unitPos = unit.Position;
M2C_PathfindingResult m2CPathfindingResult = new M2C_PathfindingResult();
m2CPathfindingResult.X = unitPos.x;
m2CPathfindingResult.Y = unitPos.y;
m2CPathfindingResult.Z = unitPos.z;
m2CPathfindingResult.Id = unit.Id;
for (int i = 0; i < offset; ++i)
{
if (index + i >= self.ABPath.Result.Count)
{
break;
}
Vector3 v = self.ABPath.Result[index + i];
m2CPathfindingResult.Xs.Add(v.x);
m2CPathfindingResult.Ys.Add(v.y);
m2CPathfindingResult.Zs.Add(v.z);
}
MessageHelper.Broadcast(m2CPathfindingResult);
}
}
}
\ No newline at end of file
using System;
using System.Threading.Tasks;
using ETModel;
namespace ETHotfix
{
[ActorMessageHandler(AppType.Map)]
public class OneFrameMessageHandler: AMActorLocationHandler<Unit, OneFrameMessage>
{
protected override void Run(Unit unit, OneFrameMessage message)
{
Game.Scene.GetComponent<ServerFrameComponent>().Add(message);
}
}
}
using ETModel;
namespace ETHotfix
{
[ObjectSystem]
public class ServerFrameComponentSystem : AwakeSystem<ServerFrameComponent>
{
public override void Awake(ServerFrameComponent self)
{
self.Awake();
}
}
public static class ServerFrameComponentEx
{
public static void Awake(this ServerFrameComponent self)
{
self.Frame = 0;
self.FrameMessage = new FrameMessage() {Frame = self.Frame};
self.UpdateFrameAsync();
}
public static async void UpdateFrameAsync(this ServerFrameComponent self)
{
TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
long instanceId = self.InstanceId;
while (true)
{
if (self.InstanceId != instanceId)
{
return;
}
await timerComponent.WaitAsync(100);
MessageHelper.Broadcast(self.FrameMessage);
++self.Frame;
self.FrameMessage = new FrameMessage() { Frame = self.Frame };
}
}
public static void Add(this ServerFrameComponent self, OneFrameMessage oneFrameMessage)
{
self.FrameMessage.Message.Add(oneFrameMessage);
}
}
}
\ No newline at end of file
......@@ -12,21 +12,6 @@ namespace ETHotfix
{
switch (message)
{
case IFrameMessage iFrameMessage: // 如果是帧消息,构造成OneFrameMessage发给对应的unit
{
long unitId = session.GetComponent<SessionPlayerComponent>().Player.UnitId;
ActorLocationSender actorLocationSender = Game.Scene.GetComponent<ActorLocationSenderComponent>().Get(unitId);
// 这里设置了帧消息的id,防止客户端伪造
iFrameMessage.Id = unitId;
OneFrameMessage oneFrameMessage = new OneFrameMessage
{
Op = opcode, AMessage = ByteString.CopyFrom(session.Network.MessagePacker.SerializeTo(iFrameMessage))
};
actorLocationSender.Send(oneFrameMessage);
return;
}
case IActorLocationRequest actorLocationRequest: // gate session收到actor rpc消息,先向actor 发送rpc请求,再将请求结果返回客户端
{
long unitId = session.GetComponent<SessionPlayerComponent>().Player.UnitId;
......
......@@ -45,5 +45,10 @@ namespace ETModel
{
globalLog.Fatal(message);
}
public static void Msg(object msg)
{
Debug(MongoHelper.ToJson(msg));
}
}
}
using System.Numerics;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Attributes;
using PF;
namespace ETModel
{
......
using System.Threading;
using System.Threading.Tasks;
using PF;
namespace ETModel
{
public class MoveComponent: Component
{
public Vector3 Target;
// 开启移动协程的时间
public long StartTime;
public long lastFrameTime;
// 开启移动协程的Unit的位置
public Vector3 StartPos;
// 移动的方向标准化
public Vector3 DirNormalized;
// 当前的移动速度
public float Speed = 5;
public void Awake()
{
this.Target = this.GetParent<Unit>().Position;
}
// 开启协程移动,每100毫秒移动一次,并且协程取消的时候会计算玩家真实移动
// 比方说玩家移动了2500毫秒,玩家有新的目标,这时旧的移动协程结束,将计算250毫秒移动的位置,而不是300毫秒移动的位置
public async Task StartMove(CancellationToken cancellationToken)
{
Unit unit = this.GetParent<Unit>();
this.StartPos = unit.Position;
this.StartTime = TimeHelper.Now();
this.DirNormalized = (this.Target - unit.Position).normalized;
TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
// 协程如果取消,将算出玩家的真实位置,赋值给玩家
cancellationToken.Register(() =>
{
// 算出当前玩家的位置
long timeNow = TimeHelper.Now();
unit.Position = StartPos + this.DirNormalized * this.Speed * (timeNow - this.StartTime) / 1000f;
});
while (true)
{
Vector3 willPos = unit.Position + this.DirNormalized * this.Speed * 0.05f;
if ((willPos - this.StartPos).magnitude > (this.Target - this.StartPos).magnitude - 0.1f)
{
unit.Position = this.Target;
break;
}
await timerComponent.WaitAsync(50, cancellationToken);
long timeNow = TimeHelper.Now();
lastFrameTime = timeNow;
unit.Position = StartPos + this.DirNormalized * this.Speed * (timeNow - this.StartTime) / 1000f;
}
}
public async Task MoveToAsync(Vector3 target, CancellationToken cancellationToken)
{
// 新目标点离旧目标点太近,不设置新的
if ((target - this.Target).sqrMagnitude < 0.01f)
{
return;
}
// 距离当前位置太近
if ((this.GetParent<Unit>().Position - target).sqrMagnitude < 0.01f)
{
return;
}
this.Target = target;
// 开启协程移动
await StartMove(cancellationToken);
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using System.Threading;
using PF;
namespace ETModel
{
public class UnitPathComponent: Component
{
public Vector3 Target;
private ABPath abPath;
public List<Vector3> Path;
public CancellationTokenSource CancellationTokenSource;
public ABPath ABPath
{
get
{
return this.abPath;
}
set
{
this.abPath?.Dispose();
this.abPath = value;
}
}
public override void Dispose()
{
if (this.IsDisposed)
{
return;
}
base.Dispose();
this.abPath?.Dispose();
}
}
}
\ No newline at end of file
namespace ETModel
{
public class ServerFrameComponent: Component
{
public int Frame;
public FrameMessage FrameMessage;
}
}
......@@ -367,9 +367,13 @@ namespace ETModel
public string Message { get; set; }
// 自己的unit id
// 自己的unit id
public long UnitId { get; set; }
public int Count { get; set; }
// 所有的unit
// 所有的unit
public List<UnitInfo> Units = new List<UnitInfo>();
}
......
using System.Collections.Generic;
using PF;
namespace ETModel
{
[ObjectSystem]
public class ABPathAwakeSystem : AwakeSystem<ABPath, Vector3, Vector3>
{
public override void Awake(ABPath self, Vector3 start, Vector3 end)
{
self.Awake(start, end);
}
}
public class ABPath: Component
{
public Path Path { get; private set; }
public void Awake(Vector3 start, Vector3 end)
{
this.Path = PF.ABPath.Construct(start, end);
this.Path.Claim(this);
}
public List<Vector3> Result
{
get
{
return this.Path.vectorPath;
}
}
public override void Dispose()
{
if (this.IsDisposed)
{
return;
}
base.Dispose();
this.Path.Release(this);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using PF;
using Guid = PF.Guid;
namespace ETModel
{
public static class DeserializeHelper
{
public static NavGraph[] Load(string filePath)
{
byte[] bytes = AstarSerializer.LoadFromFile(filePath);
AstarSerializer sr = new AstarSerializer();
if (!sr.OpenDeserialize(bytes))
{
throw new Exception("Invalid data file (cannot read zip).\nThe data is either corrupt or it was saved using a 3.0.x or earlier version of the system");
}
var gr = new List<NavGraph>();
// Set an offset so that the deserializer will load
// the graphs with the correct graph indexes
sr.SetGraphIndexOffset(gr.Count);
gr.AddRange(sr.DeserializeGraphs());
NavGraph[] graphs = gr.ToArray();
sr.DeserializeEditorSettingsCompatibility();
sr.DeserializeExtraInfo();
//Assign correct graph indices.
for (int i = 0; i < graphs.Length; i++)
{
if (graphs[i] == null)
{
continue;
}
int i1 = i;
graphs[i].GetNodes(node => node.GraphIndex = (uint)i1);
}
for (int i = 0; i < graphs.Length; i++)
{
for (int j = i+1; j < graphs.Length; j++)
{
if (graphs[i] != null && graphs[j] != null && graphs[i].guid == graphs[j].guid)
{
graphs[i].guid = Guid.NewGuid();
break;
}
}
}
sr.PostDeserialization();
sr.CloseDeserialize();
return graphs;
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using PF;
namespace ETModel
{
public static class PathModifyHelper
{
public static void StartEndModify(PF.ABPath abPath)
{
if (abPath.vectorPath.Count == 1)
{
abPath.vectorPath.Add(abPath.vectorPath[0]);
}
abPath.vectorPath[0] = abPath.startPoint;
abPath.vectorPath[abPath.vectorPath.Count - 1] = abPath.endPoint;
}
public static void FunnelModify (Path p) {
if (p.path == null || p.path.Count == 0 || p.vectorPath == null || p.vectorPath.Count == 0) {
return;
}
List<Vector3> funnelPath = ListPool<Vector3>.Claim();
// Split the path into different parts (separated by custom links)
// and run the funnel algorithm on each of them in turn
var parts = Funnel.SplitIntoParts(p);
if (parts.Count == 0) {
// As a really special case, it might happen that the path contained only a single node
// and that node was part of a custom link (e.g added by the NodeLink2 component).
// In that case the SplitIntoParts method will not know what to do with it because it is
// neither a link (as only 1 of the 2 nodes of the link was part of the path) nor a normal
// path part. So it will skip it. This will cause it to return an empty list.
// In that case we want to simply keep the original path, which is just a single point.
return;
}
for (int i = 0; i < parts.Count; i++) {
var part = parts[i];
if (!part.isLink) {
var portals = Funnel.ConstructFunnelPortals(p.path, part);
var result = Funnel.Calculate(portals, true, false);
funnelPath.AddRange(result);
ListPool<Vector3>.Release(ref portals.left);
ListPool<Vector3>.Release(ref portals.right);
ListPool<Vector3>.Release(ref result);
} else {
// non-link parts will add the start/end points for the adjacent parts.
// So if there is no non-link part before this one, then we need to add the start point of the link
// and if there is no non-link part after this one, then we need to add the end point.
if (i == 0 || parts[i-1].isLink) {
funnelPath.Add(part.startPoint);
}
if (i == parts.Count - 1 || parts[i+1].isLink) {
funnelPath.Add(part.endPoint);
}
}
}
ListPool<Funnel.PathPart>.Release(ref parts);
// Pool the previous vectorPath
ListPool<Vector3>.Release(ref p.vectorPath);
p.vectorPath = funnelPath;
}
}
}
\ No newline at end of file
using PF;
namespace ETModel
{
[ObjectSystem]
public class PathfindingComponentAwakeSystem : AwakeSystem<PathfindingComponent>
{
public override void Awake(PathfindingComponent self)
{
self.PathReturnQueue = new PathReturnQueue(self);
self.PathProcessor = new PathProcessor(self.PathReturnQueue, 1, false);
// 读取寻路配置
self.AStarConfig = new AStarConfig(); //MongoHelper.FromJson<AStarConfig>(File.ReadAllText("./pathfinding.config"));
self.AStarConfig.pathProcessor = self.PathProcessor;
// 读取地图数据
self.AStarConfig.graphs = DeserializeHelper.Load("./graph.bytes");
}
}
public class PathfindingComponent: Component
{
public PathReturnQueue PathReturnQueue;
public PathProcessor PathProcessor;
public AStarConfig AStarConfig;
public bool Search(ABPath path)
{
this.PathProcessor.queue.Push(path.Path);
while (this.PathProcessor.CalculatePaths().MoveNext())
{
if (path.Path.CompleteState != PathCompleteState.NotCalculated)
{
break;
}
}
if (path.Path.CompleteState != PathCompleteState.Complete)
{
return false;
}
PathModifyHelper.StartEndModify((PF.ABPath)path.Path);
PathModifyHelper.FunnelModify(path.Path);
return true;
}
}
}
\ No newline at end of file
......@@ -10,13 +10,48 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETCOREAPP2_0;SERVER</DefineConstants>
<OutputPath>..\..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>TRACE;RELEASE;NETCOREAPP2_0;SERVER</DefineConstants>
<OutputPath>..\..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Libs\**" />
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Color32.cs">
<Link>Base\UnityMath\Color32.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\FrameworkResources.cs">
<Link>Base\UnityMath\FrameworkResources.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Mathf.cs">
<Link>Base\UnityMath\Mathf.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\MathHelper.cs">
<Link>Base\UnityMath\MathHelper.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Matrix3x3.cs">
<Link>Base\UnityMath\Matrix3x3.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Matrix4x4.cs">
<Link>Base\UnityMath\Matrix4x4.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\PackUtils.cs">
<Link>Base\UnityMath\PackUtils.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Quaternion.cs">
<Link>Base\UnityMath\Quaternion.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Vector2.cs">
<Link>Base\UnityMath\Vector2.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Vector3.cs">
<Link>Base\UnityMath\Vector3.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\UnityMath\Vector4.cs">
<Link>Base\UnityMath\Vector4.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\ActorLocation\IActorLocationMessage.cs">
<Link>Module\ActorLocation\IActorLocationMessage.cs</Link>
</Compile>
......@@ -96,8 +131,6 @@
<Compile Include="..\..\Unity\Assets\Model\Module\Config\ACategory.cs" Link="Module\Config\ACategory.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Config\ConfigAttribute.cs" Link="Module\Config\ConfigAttribute.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Config\IConfig.cs" Link="Module\Config\IConfig.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\FrameSync\FrameMessage.cs" Link="Module\FrameSync\FrameMessage.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\FrameSync\FrameOpcode.cs" Link="Module\FrameSync\FrameOpcode.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Message\AMHandler.cs" Link="Module\Message\AMHandler.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Message\ErrorCode.cs" Link="Module\Message\ErrorCode.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Message\IMessage.cs" Link="Module\Message\IMessage.cs" />
......@@ -132,6 +165,135 @@
<Compile Include="..\..\Unity\Assets\Model\Module\Numeric\NumericType.cs" Link="Module\Numeric\NumericType.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Numeric\NumericWatcherAttribute.cs" Link="Module\Numeric\NumericWatcherAttribute.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Numeric\NumericWatcherComponent.cs" Link="Module\Numeric\NumericWatcherComponent.cs" />
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\ArrayPool.cs">
<Link>Module\Pathfinding\Recast\ArrayPool.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\AstarChecksum.cs">
<Link>Module\Pathfinding\Recast\AstarChecksum.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\AStarConfig.cs">
<Link>Module\Pathfinding\Recast\AStarConfig.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\AstarDeserializer.cs">
<Link>Module\Pathfinding\Recast\AstarDeserializer.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\AstarMath.cs">
<Link>Module\Pathfinding\Recast\AstarMath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\AstarMemory.cs">
<Link>Module\Pathfinding\Recast\AstarMemory.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\BBTree.cs">
<Link>Module\Pathfinding\Recast\BBTree.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\BinaryHeap.cs">
<Link>Module\Pathfinding\Recast\BinaryHeap.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\EuclideanEmbedding.cs">
<Link>Module\Pathfinding\Recast\EuclideanEmbedding.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Funnel.cs">
<Link>Module\Pathfinding\Recast\Funnel.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\GraphNode.cs">
<Link>Module\Pathfinding\Recast\GraphNode.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\GraphTransform.cs">
<Link>Module\Pathfinding\Recast\GraphTransform.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Guid.cs">
<Link>Module\Pathfinding\Recast\Guid.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\INavmesh.cs">
<Link>Module\Pathfinding\Recast\INavmesh.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Int3.cs">
<Link>Module\Pathfinding\Recast\Int3.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\IntRect.cs">
<Link>Module\Pathfinding\Recast\IntRect.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\ListPool.cs">
<Link>Module\Pathfinding\Recast\ListPool.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\NavGraph.cs">
<Link>Module\Pathfinding\Recast\NavGraph.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\NavmeshBase.cs">
<Link>Module\Pathfinding\Recast\NavmeshBase.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\NavmeshTile.cs">
<Link>Module\Pathfinding\Recast\NavmeshTile.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\NN.cs">
<Link>Module\Pathfinding\Recast\NN.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\ObjectPool.cs">
<Link>Module\Pathfinding\Recast\ObjectPool.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Path.cs">
<Link>Module\Pathfinding\Recast\Path.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\ABPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\ABPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\ConstantPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\ConstantPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\FleePath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\FleePath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\FloodPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\FloodPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\FloodPathTracer.cs">
<Link>Module\Pathfinding\Recast\FloodPathTracer.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\MultiTargetPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\MultiTargetPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\RandomPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\RandomPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Pathfinders\XPath.cs">
<Link>Module\Pathfinding\Recast\Pathfinders\XPath.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\PathFindHelper.cs">
<Link>Module\Pathfinding\Recast\PathFindHelper.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\PathHandler.cs">
<Link>Module\Pathfinding\Recast\PathHandler.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\PathPool.cs">
<Link>Module\Pathfinding\Recast\PathPool.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\PathProcessor.cs">
<Link>Module\Pathfinding\Recast\PathProcessor.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\PathReturnQueue.cs">
<Link>Module\Pathfinding\Recast\PathReturnQueue.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\RecastGenerator.cs">
<Link>Module\Pathfinding\Recast\RecastGenerator.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Serialization\JsonSerializer.cs">
<Link>Module\Pathfinding\Recast\Serialization\JsonSerializer.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Serialization\SimpleZipReplacement.cs">
<Link>Module\Pathfinding\Recast\Serialization\SimpleZipReplacement.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\Serialization\TinyJson.cs">
<Link>Module\Pathfinding\Recast\Serialization\TinyJson.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\ThreadControlQueue.cs">
<Link>Module\Pathfinding\Recast\ThreadControlQueue.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\TriangleMeshNode.cs">
<Link>Module\Pathfinding\Recast\TriangleMeshNode.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Module\Pathfinding\Recast\WindowsStoreCompatibility.cs">
<Link>Module\Pathfinding\Recast\WindowsStoreCompatibility.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Other\AppType.cs" Link="Other\AppType.cs" />
<Compile Include="..\..\Unity\Assets\Hotfix\Module\Message\HotfixMessage.cs" Link="Module\Message\HotfixMessage.cs" />
<Compile Include="..\..\Unity\Assets\Hotfix\Module\Message\HotfixOpcode.cs" Link="Module\Message\HotfixOpcode.cs" />
......@@ -157,4 +319,14 @@
<Folder Include="Module\Message\MessagePool\" />
<Folder Include="Module\Numeric\" />
</ItemGroup>
<ItemGroup>
<Reference Include="Pathfinding.Ionic.Zip.Reduced, Version=1.9.1.9000, Culture=neutral, PublicKeyToken=null">
<HintPath>..\ThirdParty\Pathfinding.Ionic.Zip.Reduced.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="graph.bytes">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
此差异已折叠。
fileFormatVersion: 2
guid: 58d8ce7e0909c6344be69282ddc9ddec
folderAsset: yes
timeCreated: 1536749367
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
namespace Pathfinding {
[CustomEditor(typeof(AIBase), true)]
[CanEditMultipleObjects]
public class BaseAIEditor : EditorBase {
protected SerializedProperty gravity, groundMask, centerOffset, rotationIn2D, acceleration;
float lastSeenCustomGravity = float.NegativeInfinity;
protected override void OnEnable () {
base.OnEnable();
gravity = serializedObject.FindProperty("gravity");
groundMask = serializedObject.FindProperty("groundMask");
centerOffset = serializedObject.FindProperty("centerOffset");
rotationIn2D = serializedObject.FindProperty("rotationIn2D");
acceleration = serializedObject.FindProperty("maxAcceleration");
}
protected override void Inspector () {
// Iterate over all properties of the script
var p = serializedObject.GetIterator();
p.Next(true);
while (p.NextVisible(false)) {
if (!SerializedProperty.EqualContents(p, groundMask) && !SerializedProperty.EqualContents(p, centerOffset) && !SerializedProperty.EqualContents(p, gravity) && !SerializedProperty.EqualContents(p, rotationIn2D)) {
if (SerializedProperty.EqualContents(p, acceleration) && typeof(AIPath).IsAssignableFrom(target.GetType())) {
EditorGUI.BeginChangeCheck();
int grav = acceleration.hasMultipleDifferentValues ? -1 : (acceleration.floatValue >= 0 ? 1 : 0);
var ngrav = EditorGUILayout.Popup("Max Acceleration", grav, new [] { "Default", "Custom" });
if (EditorGUI.EndChangeCheck()) {
if (ngrav == 0) acceleration.floatValue = -2.5f;
else if (acceleration.floatValue < 0) acceleration.floatValue = 10;
}
if (!acceleration.hasMultipleDifferentValues && ngrav == 1) {
EditorGUI.indentLevel++;
PropertyField(acceleration.propertyPath);
EditorGUI.indentLevel--;
acceleration.floatValue = Mathf.Max(acceleration.floatValue, 0.01f);
}
} else {
PropertyField(p);
}
}
}
PropertyField(rotationIn2D);
var mono = target as MonoBehaviour;
var rigid = mono.GetComponent<Rigidbody>();
var rigid2D = mono.GetComponent<Rigidbody2D>();
var controller = mono.GetComponent<CharacterController>();
var canUseGravity = (controller != null && controller.enabled) || ((rigid == null || rigid.isKinematic) && (rigid2D == null || rigid2D.isKinematic));
if (canUseGravity) {
EditorGUI.BeginChangeCheck();
int grav = gravity.hasMultipleDifferentValues ? -1 : (gravity.vector3Value == Vector3.zero ? 0 : (float.IsNaN(gravity.vector3Value.x) ? 1 : 2));
var ngrav = EditorGUILayout.Popup("Gravity", grav, new [] { "None", "Use Project Settings", "Custom" });
if (EditorGUI.EndChangeCheck()) {
if (ngrav == 0) gravity.vector3Value = Vector3.zero;
else if (ngrav == 1) gravity.vector3Value = new Vector3(float.NaN, float.NaN, float.NaN);
else if (float.IsNaN(gravity.vector3Value.x) || gravity.vector3Value == Vector3.zero) gravity.vector3Value = Physics.gravity;
lastSeenCustomGravity = float.NegativeInfinity;
}
if (!gravity.hasMultipleDifferentValues) {
// A sort of delayed Vector3 field (to prevent the field from dissappearing if you happen to enter zeroes into x, y and z for a short time)
// Note: cannot use != in this case because that will not give the correct result in case of NaNs
if (!(gravity.vector3Value == Vector3.zero)) lastSeenCustomGravity = Time.realtimeSinceStartup;
if (Time.realtimeSinceStartup - lastSeenCustomGravity < 2f) {
EditorGUI.indentLevel++;
if (!float.IsNaN(gravity.vector3Value.x)) {
PropertyField(gravity.propertyPath);
}
if (controller == null || !controller.enabled) {
PropertyField(groundMask.propertyPath, "Raycast Ground Mask");
PropertyField(centerOffset.propertyPath, "Raycast Center Offset");
}
EditorGUI.indentLevel--;
}
}
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.Popup(new GUIContent(gravity.displayName, "Disabled because a non-kinematic rigidbody is attached"), 0, new [] { new GUIContent("Handled by Rigidbody") });
EditorGUI.EndDisabledGroup();
}
if ((rigid != null || rigid2D != null) && (controller != null && controller.enabled)) {
EditorGUILayout.HelpBox("You are using both a Rigidbody and a Character Controller. Those components are not really designed for that. Please use only one of them.", MessageType.Warning);
}
}
}
}
fileFormatVersion: 2
guid: ab4eeab9df88a4d069163baf60aad496
timeCreated: 1489745284
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
namespace Pathfinding {
[CustomEditor(typeof(AILerp), true)]
[CanEditMultipleObjects]
public class AILerpEditor : EditorBase {
protected override void Inspector () {
PropertyField("speed");
PropertyField("repathRate");
PropertyField("canSearch");
PropertyField("canMove");
if (PropertyField("enableRotation")) {
EditorGUI.indentLevel++;
PropertyField("rotationSpeed");
PropertyField("rotationIn2D");
EditorGUI.indentLevel--;
}
if (PropertyField("interpolatePathSwitches")) {
EditorGUI.indentLevel++;
PropertyField("switchPathInterpolationSpeed");
EditorGUI.indentLevel--;
}
}
}
}
fileFormatVersion: 2
guid: e9e1d37b65158413c85aad4706d94ff0
timeCreated: 1495016528
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: aa27fa41f8abe460a8b64e13d7be43ad
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
namespace Pathfinding {
/** Handles update checking for the A* Pathfinding Project */
[InitializeOnLoad]
public static class AstarUpdateChecker {
/** Used for downloading new version information */
static WWW updateCheckDownload;
static System.DateTime _lastUpdateCheck;
static bool _lastUpdateCheckRead;
static System.Version _latestVersion;
static System.Version _latestBetaVersion;
/** Description of the latest update of the A* Pathfinding Project */
static string _latestVersionDescription;
static bool hasParsedServerMessage;
/** Number of days between update checks */
const double updateCheckRate = 1F;
/** URL to the version file containing the latest version number. */
const string updateURL = "http://www.arongranberg.com/astar/version.php";
/** Last time an update check was made */
public static System.DateTime lastUpdateCheck {
get {
try {
// Reading from EditorPrefs is relatively slow, avoid it
if (_lastUpdateCheckRead) return _lastUpdateCheck;
_lastUpdateCheck = System.DateTime.Parse(EditorPrefs.GetString("AstarLastUpdateCheck", "1/1/1971 00:00:01"), System.Globalization.CultureInfo.InvariantCulture);
_lastUpdateCheckRead = true;
}
catch (System.FormatException) {
lastUpdateCheck = System.DateTime.UtcNow;
Debug.LogWarning("Invalid DateTime string encountered when loading from preferences");
}
return _lastUpdateCheck;
}
private set {
_lastUpdateCheck = value;
EditorPrefs.SetString("AstarLastUpdateCheck", _lastUpdateCheck.ToString(System.Globalization.CultureInfo.InvariantCulture));
}
}
/** Latest version of the A* Pathfinding Project */
public static System.Version latestVersion {
get {
RefreshServerMessage();
return _latestVersion ?? AstarPath.Version;
}
private set {
_latestVersion = value;
}
}
/** Latest beta version of the A* Pathfinding Project */
public static System.Version latestBetaVersion {
get {
RefreshServerMessage();
return _latestBetaVersion ?? AstarPath.Version;
}
private set {
_latestBetaVersion = value;
}
}
/** Summary of the latest update */
public static string latestVersionDescription {
get {
RefreshServerMessage();
return _latestVersionDescription ?? "";
}
private set {
_latestVersionDescription = value;
}
}
/** Holds various URLs and text for the editor.
* This info can be updated when a check for new versions is done to ensure that there are no invalid links.
*/
static Dictionary<string, string> astarServerData = new Dictionary<string, string> {
{ "URL:modifiers", "http://www.arongranberg.com/astar/docs/modifiers.php" },
{ "URL:astarpro", "http://arongranberg.com/unity/a-pathfinding/astarpro/" },
{ "URL:documentation", "http://arongranberg.com/astar/docs/" },
{ "URL:findoutmore", "http://arongranberg.com/astar" },
{ "URL:download", "http://arongranberg.com/unity/a-pathfinding/download" },
{ "URL:changelog", "http://arongranberg.com/astar/docs/changelog.php" },
{ "URL:tags", "http://arongranberg.com/astar/docs/tags.php" },
{ "URL:homepage", "http://arongranberg.com/astar/" }
};
static AstarUpdateChecker() {
// Add a callback so that we can parse the message when it has been downloaded
EditorApplication.update += UpdateCheckLoop;
}
static void RefreshServerMessage () {
if (!hasParsedServerMessage) {
var serverMessage = EditorPrefs.GetString("AstarServerMessage");
if (!string.IsNullOrEmpty(serverMessage)) {
ParseServerMessage(serverMessage);
ShowUpdateWindowIfRelevant();
}
}
}
public static string GetURL (string tag) {
RefreshServerMessage();
string url;
astarServerData.TryGetValue("URL:"+tag, out url);
return url ?? "";
}
/** Initiate a check for updates now, regardless of when the last check was done */
public static void CheckForUpdatesNow () {
lastUpdateCheck = System.DateTime.UtcNow.AddDays(-5);
// Remove the callback if it already exists
EditorApplication.update -= UpdateCheckLoop;
// Add a callback so that we can parse the message when it has been downloaded
EditorApplication.update += UpdateCheckLoop;
}
/**
* Checking for updates...
* Should be called from EditorApplication.update
*/
static void UpdateCheckLoop () {
// Go on until the update check has been completed
if (!CheckForUpdates()) {
EditorApplication.update -= UpdateCheckLoop;
}
}
/** Checks for updates if there was some time since last check.
* It must be called repeatedly to ensure that the result is processed.
* \returns True if an update check is progressing (WWW request)
*/
static bool CheckForUpdates () {
if (updateCheckDownload != null && updateCheckDownload.isDone) {
if (!string.IsNullOrEmpty(updateCheckDownload.error)) {
Debug.LogWarning("There was an error checking for updates to the A* Pathfinding Project\n" +
"The error might disappear if you switch build target from Webplayer to Standalone because of the webplayer security emulation\nError: " +
updateCheckDownload.error);
updateCheckDownload = null;
return false;
}
UpdateCheckCompleted(updateCheckDownload.text);
updateCheckDownload = null;
}
// Check if it is time to check for updates
// Check for updates a bit earlier if we are in play mode or have the AstarPath object in the scene
// as then the collected statistics will be a bit more accurate
var offsetMinutes = (Application.isPlaying && Time.time > 60) || AstarPath.active != null ? -20 : 20;
var minutesUntilUpdate = lastUpdateCheck.AddDays(updateCheckRate).AddMinutes(offsetMinutes).Subtract(System.DateTime.UtcNow).TotalMinutes;
if (minutesUntilUpdate < 0) {
DownloadVersionInfo();
}
return updateCheckDownload != null || minutesUntilUpdate < 10;
}
static void DownloadVersionInfo () {
var script = AstarPath.active != null ? AstarPath.active : GameObject.FindObjectOfType(typeof(AstarPath)) as AstarPath;
if (script != null) {
script.ConfigureReferencesInternal();
if ((!Application.isPlaying && (script.data.graphs == null || script.data.graphs.Length == 0)) || script.data.graphs == null) {
script.data.DeserializeGraphs();
}
}
bool mecanim = GameObject.FindObjectOfType(typeof(Animator)) != null;
string query = updateURL+
"?v="+AstarPath.Version+
"&pro=1"+
"&check="+updateCheckRate+"&distr="+AstarPath.Distribution+
"&unitypro="+(Application.HasProLicense() ? "1" : "0")+
"&inscene="+(script != null ? "1" : "0")+
"&targetplatform="+EditorUserBuildSettings.activeBuildTarget+
"&devplatform="+Application.platform+
"&mecanim="+(mecanim ? "1" : "0")+
"&hasNavmesh=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "NavMeshGraph") ? 1 : 0) +
"&hasPoint=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "PointGraph") ? 1 : 0) +
"&hasGrid=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "GridGraph") ? 1 : 0) +
"&hasLayered=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "LayerGridGraph") ? 1 : 0) +
"&hasRecast=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "RecastGraph") ? 1 : 0) +
"&hasGrid=" + (script != null && script.data.graphs.Any(g => g.GetType().Name == "GridGraph") ? 1 : 0) +
"&hasCustom=" + (script != null && script.data.graphs.Any(g => g != null && !g.GetType().FullName.Contains("Pathfinding.")) ? 1 : 0) +
"&graphCount=" + (script != null ? script.data.graphs.Count(g => g != null) : 0) +
"&unityversion="+Application.unityVersion +
"&branch="+AstarPath.Branch;
updateCheckDownload = new WWW(query);
lastUpdateCheck = System.DateTime.UtcNow;
}
/** Handles the data from the update page */
static void UpdateCheckCompleted (string result) {
EditorPrefs.SetString("AstarServerMessage", result);
ParseServerMessage(result);
ShowUpdateWindowIfRelevant();
}
static void ParseServerMessage (string result) {
if (string.IsNullOrEmpty(result)) {
return;
}
hasParsedServerMessage = true;
#if ASTARDEBUG
Debug.Log("Result from update check:\n"+result);
#endif
string[] splits = result.Split('|');
latestVersionDescription = splits.Length > 1 ? splits[1] : "";
if (splits.Length > 4) {
// First 4 are just compatibility fields
var fields = splits.Skip(4).ToArray();
// Take all pairs of fields
for (int i = 0; i < (fields.Length/2)*2; i += 2) {
string key = fields[i];
string val = fields[i+1];
astarServerData[key] = val;
}
}
try {
latestVersion = new System.Version(astarServerData["VERSION:branch"]);
} catch (System.Exception ex) {
Debug.LogWarning("Could not parse version\n"+ex);
}
try {
latestBetaVersion = new System.Version(astarServerData["VERSION:beta"]);
} catch (System.Exception ex) {
Debug.LogWarning("Could not parse version\n"+ex);
}
}
static void ShowUpdateWindowIfRelevant () {
try {
System.DateTime remindDate;
var remindVersion = new System.Version(EditorPrefs.GetString("AstarRemindUpdateVersion", "0.0.0.0"));
if (latestVersion == remindVersion && System.DateTime.TryParse(EditorPrefs.GetString("AstarRemindUpdateDate", "1/1/1971 00:00:01"), out remindDate)) {
if (System.DateTime.UtcNow < remindDate) {
// Don't remind yet
return;
}
} else {
EditorPrefs.DeleteKey("AstarRemindUpdateDate");
EditorPrefs.DeleteKey("AstarRemindUpdateVersion");
}
} catch {
Debug.LogError("Invalid AstarRemindUpdateVersion or AstarRemindUpdateDate");
}
var skipVersion = new System.Version(EditorPrefs.GetString("AstarSkipUpToVersion", AstarPath.Version.ToString()));
if (AstarPathEditor.FullyDefinedVersion(latestVersion) != AstarPathEditor.FullyDefinedVersion(skipVersion) && AstarPathEditor.FullyDefinedVersion(latestVersion) > AstarPathEditor.FullyDefinedVersion(AstarPath.Version)) {
EditorPrefs.DeleteKey("AstarSkipUpToVersion");
EditorPrefs.DeleteKey("AstarRemindUpdateDate");
EditorPrefs.DeleteKey("AstarRemindUpdateVersion");
AstarUpdateWindow.Init(latestVersion, latestVersionDescription);
}
}
}
}
fileFormatVersion: 2
guid: 8df9913c9ee004459b24d89644e573d7
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
using System;
using UnityEditor;
using UnityEngine;
namespace Pathfinding {
public class AstarUpdateWindow : EditorWindow {
static GUIStyle largeStyle;
static GUIStyle normalStyle;
Version version;
string summary;
bool setReminder;
public static AstarUpdateWindow Init (Version version, string summary) {
// Get existing open window or if none, make a new one:
AstarUpdateWindow window = EditorWindow.GetWindow<AstarUpdateWindow>(true, "", true);
window.position = new Rect(Screen.currentResolution.width/2 - 300, Mathf.Max(5, Screen.currentResolution.height/3 - 150), 600, 400);
window.version = version;
window.summary = summary;
#if UNITY_4_6 || UNITY_5_0
window.title = "New Version of the A* Pathfinding Project";
#else
window.titleContent = new GUIContent("New Version of the A* Pathfinding Project");
#endif
return window;
}
public void OnDestroy () {
if (version != null && !setReminder) {
Debug.Log("Closed window, reminding again tomorrow");
EditorPrefs.SetString("AstarRemindUpdateDate", DateTime.UtcNow.AddDays(1).ToString(System.Globalization.CultureInfo.InvariantCulture));
EditorPrefs.SetString("AstarRemindUpdateVersion", version.ToString());
}
}
void OnGUI () {
if (largeStyle == null) {
largeStyle = new GUIStyle(EditorStyles.largeLabel);
largeStyle.fontSize = 32;
largeStyle.alignment = TextAnchor.UpperCenter;
largeStyle.richText = true;
normalStyle = new GUIStyle(EditorStyles.label);
normalStyle.wordWrap = true;
normalStyle.richText = true;
}
if (version == null) {
return;
}
GUILayout.Label("New Update Available!", largeStyle);
GUILayout.Label("There is a new version of the <b>A* Pathfinding Project</b> available for download.\n" +
"The new version is <b>" + version + "</b> you have <b>" + AstarPath.Version + "</b>\n\n"+
"<i>Summary:</i>\n"+summary, normalStyle
);
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
GUILayout.BeginVertical();
Color col = GUI.color;
GUI.backgroundColor *= new Color(0.5f, 1f, 0.5f);
if (GUILayout.Button("Take me to the download page!", GUILayout.Height(30), GUILayout.MaxWidth(300))) {
Application.OpenURL(AstarUpdateChecker.GetURL("download"));
}
GUI.backgroundColor = col;
if (GUILayout.Button("What's new? (full changelog)")) {
Application.OpenURL(AstarUpdateChecker.GetURL("changelog"));
}
GUILayout.EndVertical();
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
if (GUILayout.Button("Skip this version", GUILayout.MaxWidth(100))) {
EditorPrefs.SetString("AstarSkipUpToVersion", version.ToString());
setReminder = true;
Close();
}
if (GUILayout.Button("Remind me later ( 1 week )", GUILayout.MaxWidth(200))) {
EditorPrefs.SetString("AstarRemindUpdateDate", DateTime.UtcNow.AddDays(7).ToString(System.Globalization.CultureInfo.InvariantCulture));
EditorPrefs.SetString("AstarRemindUpdateVersion", version.ToString());
setReminder = true;
Close();
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
}
}
}
fileFormatVersion: 2
guid: 97d8d5fc46a644f22b0d66c6ee18e753
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
namespace Pathfinding {
/** Added to editors of custom graph types */
[System.AttributeUsage(System.AttributeTargets.All, Inherited = false, AllowMultiple = true)]
public class CustomGraphEditorAttribute : System.Attribute {
/** Graph type which this is an editor for */
public System.Type graphType;
/** Name displayed in the inpector */
public string displayName;
/** Type of the editor for the graph */
public System.Type editorType;
public CustomGraphEditorAttribute (System.Type t, string displayName) {
graphType = t;
this.displayName = displayName;
}
}
}
fileFormatVersion: 2
guid: 576dcf42aca804a48b5923974edaee01
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
fileFormatVersion: 2
guid: 43c4f2e196bd25a429f1383adc6615a4
folderAsset: yes
timeCreated: 1536749367
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 253c7abd5d5cd044789918a8880fc867
folderAsset: yes
timeCreated: 1536749367
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0790ee8db18ed49ed8369be285199835
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
fileFormatVersion: 2
guid: b5a4a564ac2dc4261a13719673f157e1
timeCreated: 1498132652
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c730485723dee4bcbad9d8a7593a8799
timeCreated: 1498131761
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d0f7738d6b5b2420b9a77bfef3926e2a
timeCreated: 1498133640
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b9d7d6d7befb34b9c889e6195746c452
timeCreated: 1498133640
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 705155b2c3fce47f0a818ac32d5abe3f
timeCreated: 1499339103
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e8ebb72a41d314b288545fddfd20cafd
timeCreated: 1499339103
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e0cb3cc51f25a48bf8b0c647452b09b1
timeCreated: 1499339103
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f6a4baf90a7bb4e4a92abe07f1a0a9d3
timeCreated: 1499339103
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b05124c2b9dc5429a84ef0195a916fce
timeCreated: 1498128537
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3772050cdbd2a472789aa76d6de5b270
timeCreated: 1498128911
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 54ad5f6eb8a9349568e58cd1204388a2
timeCreated: 1498131017
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a454b67ef7bd04780aca99e364202679
timeCreated: 1498131017
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 11b8d44fcb3cf4c048a576df708e0ec6
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
userData:
fileFormatVersion: 2
guid: db5b85df63e094a1c96f11019bccc577
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
userData:
fileFormatVersion: 2
guid: dd113e7f4ceed0945903fc146a961735
folderAsset: yes
timeCreated: 1536749367
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0758c9e42111d4aec99694c875e9badc
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
fileFormatVersion: 2
guid: 5006aa4ede39e49198b851d98e267b5d
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
fileFormatVersion: 2
guid: 37972c32346084c13bfddb8c3dbed143
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
fileFormatVersion: 2
guid: 7ea4fc739ffbb4af1a466f655bf1d178
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 1024
textureSettings:
filterMode: 0
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册