Merge pull request 'a_star' (#5) from a_star into master
Reviewed-on: #5
This commit is contained in:
commit
3a9e511aa9
File diff suppressed because it is too large
Load Diff
78
Assets/Graphics/Materials/NodeExplored_Mat.mat
Normal file
78
Assets/Graphics/Materials/NodeExplored_Mat.mat
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: NodeExplored_Mat
|
||||||
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords:
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 0
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 1
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 0.18903318, g: 0.8773585, b: 0.16967781, a: 1}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
@ -1,7 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 97b32b60b07a2ca4296022d84adbb3a4
|
guid: 9ac24eaf07a787147878b53b3ef377bc
|
||||||
PrefabImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
@ -7,7 +7,7 @@ Material:
|
|||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: Node_mat
|
m_Name: Node_Mat
|
||||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_ShaderKeywords:
|
m_ShaderKeywords:
|
||||||
m_LightmapFlags: 4
|
m_LightmapFlags: 4
|
||||||
|
34
Assets/Logic/Agent/FringeNode.cs
Normal file
34
Assets/Logic/Agent/FringeNode.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using Logic.Utils;
|
||||||
|
|
||||||
|
namespace Logic.Agent
|
||||||
|
{
|
||||||
|
public class FringeNode: IHeapItem<FringeNode>
|
||||||
|
{
|
||||||
|
public readonly State State;
|
||||||
|
public FringeNode Parent;
|
||||||
|
public AgentAction Action;
|
||||||
|
public float HCost;
|
||||||
|
public float GCost;
|
||||||
|
public int HeapIndex { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public FringeNode(State state)
|
||||||
|
{
|
||||||
|
State = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float FCost => GCost + HCost;
|
||||||
|
|
||||||
|
|
||||||
|
public int CompareTo(FringeNode other)
|
||||||
|
{
|
||||||
|
int compare = FCost.CompareTo(other.FCost);
|
||||||
|
if (compare == 0)
|
||||||
|
{
|
||||||
|
compare = HCost.CompareTo(other.HCost);
|
||||||
|
}
|
||||||
|
|
||||||
|
return -compare;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
31
Assets/Logic/Agent/FringeNodeHeap.cs
Normal file
31
Assets/Logic/Agent/FringeNodeHeap.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using Logic.Utils;
|
||||||
|
|
||||||
|
namespace Logic.Agent
|
||||||
|
{
|
||||||
|
public class FringeNodeHeap: Heap<FringeNode>
|
||||||
|
{
|
||||||
|
public FringeNodeHeap(int maxHeapSize) : base(maxHeapSize) { }
|
||||||
|
|
||||||
|
public bool Contains(FringeNode item)
|
||||||
|
{
|
||||||
|
foreach (FringeNode fringeNode in Items)
|
||||||
|
{
|
||||||
|
if (fringeNode != null && fringeNode.State.Equals(item.State))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FringeNode GetItem(FringeNode item)
|
||||||
|
{
|
||||||
|
foreach (FringeNode fringeNode in Items)
|
||||||
|
{
|
||||||
|
if (fringeNode != null && fringeNode.State.Equals(item.State))
|
||||||
|
return fringeNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
Assets/Logic/Agent/FringeNodeHeap.cs.meta
Normal file
3
Assets/Logic/Agent/FringeNodeHeap.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 34a52f0a39ad4d9faf3238d9cd5dd6bc
|
||||||
|
timeCreated: 1619354659
|
@ -1,20 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Logic.Agent;
|
|
||||||
|
|
||||||
namespace Assets.Logic.Agent
|
|
||||||
{
|
|
||||||
public class FringeNodes
|
|
||||||
{
|
|
||||||
public FringeNodes(State state)
|
|
||||||
{
|
|
||||||
State = state;
|
|
||||||
}
|
|
||||||
public State State;
|
|
||||||
public FringeNodes Parent;
|
|
||||||
public AgentAction Action;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Assets.Logic.Agent;
|
|
||||||
using Logic.Graph;
|
using Logic.Graph;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -9,10 +8,81 @@ namespace Logic.Agent
|
|||||||
{
|
{
|
||||||
public class PathFinder : MonoBehaviour
|
public class PathFinder : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Stack<AgentAction> GraphSearch(Queue<FringeNodes> fringe, HashSet<FringeNodes> explored, State iState, State goalState)
|
|
||||||
|
public Stack<AgentAction> GraphSearchWithCost(FringeNodeHeap fringe, HashSet<FringeNode> explored, State iState, State goalState)
|
||||||
{
|
{
|
||||||
Stack<AgentAction> stack = new Stack<AgentAction>();
|
Stack<AgentAction> stack = new Stack<AgentAction>();
|
||||||
fringe.Enqueue(new FringeNodes(iState));
|
fringe.Enqueue(new FringeNode(iState));
|
||||||
|
while (fringe.Count != 0)
|
||||||
|
{
|
||||||
|
var elem = fringe.Dequeue();
|
||||||
|
if (goalTest(elem.State, goalState))
|
||||||
|
{
|
||||||
|
while (!elem.State.Equals(iState))
|
||||||
|
{
|
||||||
|
elem.State.AgentPosition.MarkAsPath();
|
||||||
|
stack.Push(elem.Action);
|
||||||
|
elem = elem.Parent;
|
||||||
|
}
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
explored.Add(elem);
|
||||||
|
foreach (Tuple<State, AgentAction> successor in Succ(elem.State))
|
||||||
|
{
|
||||||
|
var x = new FringeNode(successor.Item1)
|
||||||
|
{
|
||||||
|
Parent = elem,
|
||||||
|
Action = successor.Item2,
|
||||||
|
HCost = GetHCost(successor.Item1, goalState),
|
||||||
|
GCost = GetGCost(elem.State, successor.Item1) + elem.GCost
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!fringe.Contains(x) && !explored.Any(z => z.State.Equals(successor.Item1)))
|
||||||
|
{
|
||||||
|
fringe.Enqueue(x);
|
||||||
|
x.State.AgentPosition.MarkAsExplored();
|
||||||
|
}
|
||||||
|
else if (fringe.Contains(x) && fringe.GetItem(x).FCost > x.FCost)
|
||||||
|
{
|
||||||
|
fringe.UpdateItem(x, fringe.GetItem(x).HeapIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float GetHCost(State state1, State state2)
|
||||||
|
{
|
||||||
|
var state1Pos = state1.AgentPosition.transform.position;
|
||||||
|
var state2Pos = state2.AgentPosition.transform.position;
|
||||||
|
|
||||||
|
float distX = Mathf.Abs(state1Pos.x - state2Pos.x);
|
||||||
|
float distY = Mathf.Abs(state1Pos.z - state2Pos.z);
|
||||||
|
|
||||||
|
return distX + distY;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float GetGCost(State state1, State state2)
|
||||||
|
{
|
||||||
|
float cost = 0;
|
||||||
|
if (state1.AgentRotation != state2.AgentRotation)
|
||||||
|
{
|
||||||
|
cost += SceneContext.Instance.rotationCost;
|
||||||
|
}
|
||||||
|
else if (state1.AgentPosition != state2.AgentPosition)
|
||||||
|
{
|
||||||
|
cost += state2.AgentPosition.GETNodeCost();
|
||||||
|
}
|
||||||
|
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Stack<AgentAction> GraphSearch(Queue<FringeNode> fringe, HashSet<FringeNode> explored, State iState, State goalState)
|
||||||
|
{
|
||||||
|
Stack<AgentAction> stack = new Stack<AgentAction>();
|
||||||
|
fringe.Enqueue(new FringeNode(iState));
|
||||||
while (fringe.Count != 0)
|
while (fringe.Count != 0)
|
||||||
{
|
{
|
||||||
var elem = fringe.Dequeue();
|
var elem = fringe.Dequeue();
|
||||||
@ -34,8 +104,13 @@ namespace Logic.Agent
|
|||||||
if (fringe.Any(z =>
|
if (fringe.Any(z =>
|
||||||
z.State.Equals(successor.Item1)) || explored.Any(z => z.State.Equals(successor.Item1)))
|
z.State.Equals(successor.Item1)) || explored.Any(z => z.State.Equals(successor.Item1)))
|
||||||
continue;
|
continue;
|
||||||
var x = new FringeNodes(successor.Item1) {Parent = elem, Action = successor.Item2};
|
var x = new FringeNode(successor.Item1)
|
||||||
|
{
|
||||||
|
Parent = elem,
|
||||||
|
Action = successor.Item2
|
||||||
|
};
|
||||||
fringe.Enqueue(x);
|
fringe.Enqueue(x);
|
||||||
|
x.State.AgentPosition.MarkAsExplored();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using Logic.Graph;
|
using Logic.Graph;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Assets.Logic.Agent
|
namespace Logic.Agent
|
||||||
{
|
{
|
||||||
public enum Rotation
|
public enum Rotation
|
||||||
{
|
{
|
||||||
@ -14,12 +13,37 @@ namespace Assets.Logic.Agent
|
|||||||
{
|
{
|
||||||
public Rotation AgentRotation;
|
public Rotation AgentRotation;
|
||||||
public Node AgentPosition;
|
public Node AgentPosition;
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj == null) return false;
|
if (obj == null) return false;
|
||||||
var state = (State) obj;
|
var state = (State) obj;
|
||||||
|
|
||||||
|
if (state.AgentPosition is Table)
|
||||||
|
{
|
||||||
|
return AgentPosition == state.AgentPosition &&
|
||||||
|
(AgentRotation == GETOppositeRotation(state.AgentRotation) ||
|
||||||
|
AgentRotation == state.AgentRotation);
|
||||||
|
}
|
||||||
|
|
||||||
return AgentPosition == state.AgentPosition && AgentRotation == state.AgentRotation;
|
return AgentPosition == state.AgentPosition && AgentRotation == state.AgentRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Rotation GETOppositeRotation(Rotation rotation)
|
||||||
|
{
|
||||||
|
switch (rotation)
|
||||||
|
{
|
||||||
|
case Rotation.Bottom:
|
||||||
|
return Rotation.Top;
|
||||||
|
case Rotation.Top:
|
||||||
|
return Rotation.Bottom;
|
||||||
|
case Rotation.Left:
|
||||||
|
return Rotation.Right;
|
||||||
|
case Rotation.Right:
|
||||||
|
return Rotation.Left;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Rotation.Top;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Assets.Logic.Agent;
|
|
||||||
using Logic.Graph;
|
using Logic.Graph;
|
||||||
|
using Logic.Utils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Debug = UnityEngine.Debug;
|
using Debug = UnityEngine.Debug;
|
||||||
|
|
||||||
@ -17,11 +17,9 @@ namespace Logic.Agent
|
|||||||
}
|
}
|
||||||
public class Waitress : MonoBehaviour
|
public class Waitress : MonoBehaviour
|
||||||
{
|
{
|
||||||
//[SerializeField] private Node currentNode;
|
public Node startNode;
|
||||||
public Node StartNode;
|
|
||||||
[SerializeField] private bool isFollowingPath;
|
[SerializeField] private bool isFollowingPath;
|
||||||
[SerializeField] private bool canMove = true;
|
[SerializeField] private bool canMove = true;
|
||||||
//private Node _previousNode;
|
|
||||||
private State _currentState;
|
private State _currentState;
|
||||||
private State _previousState;
|
private State _previousState;
|
||||||
private PathFinder _pathFinder;
|
private PathFinder _pathFinder;
|
||||||
@ -29,12 +27,8 @@ namespace Logic.Agent
|
|||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
_pathFinder = GetComponent<PathFinder>();
|
_pathFinder = GetComponent<PathFinder>();
|
||||||
_currentState = new State();
|
_currentState = new State {AgentPosition = startNode, AgentRotation = Rotation.Top};
|
||||||
_currentState.AgentPosition = StartNode;
|
_previousState = new State {AgentPosition = startNode, AgentRotation = Rotation.Top};
|
||||||
_currentState.AgentRotation = Rotation.Top;
|
|
||||||
_previousState = new State();
|
|
||||||
_previousState.AgentPosition = StartNode;
|
|
||||||
_previousState.AgentRotation = Rotation.Top;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@ -74,12 +68,30 @@ namespace Logic.Agent
|
|||||||
goalState.AgentPosition = table;
|
goalState.AgentPosition = table;
|
||||||
goalState.AgentRotation = Rotation.Right;
|
goalState.AgentRotation = Rotation.Right;
|
||||||
|
|
||||||
Stack<AgentAction> actions = _pathFinder.GraphSearch(new Queue<FringeNodes>(), new HashSet<FringeNodes>(),
|
Stack<AgentAction> actions;
|
||||||
_currentState, goalState);
|
if (SceneContext.Instance.useAStar)
|
||||||
|
{
|
||||||
|
var priorityQueue = new FringeNodeHeap(SceneContext.Instance.map.Count * 3);
|
||||||
|
actions = _pathFinder.GraphSearchWithCost(priorityQueue, new HashSet<FringeNode>(), _currentState, goalState);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actions = _pathFinder.GraphSearch(new Queue<FringeNode>(), new HashSet<FringeNode>(), _currentState, goalState);
|
||||||
|
}
|
||||||
|
|
||||||
if (actions.Count > 0)
|
if (actions.Count > 0)
|
||||||
{
|
{
|
||||||
StartCoroutine(ExecuteActions(actions));
|
StartCoroutine(ExecuteActions(actions));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearMap()
|
||||||
|
{
|
||||||
|
foreach (Node node in SceneContext.Instance.map)
|
||||||
|
{
|
||||||
|
node.ClearPathMark();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator ExecuteActions(Stack<AgentAction> actions)
|
private IEnumerator ExecuteActions(Stack<AgentAction> actions)
|
||||||
@ -118,18 +130,16 @@ namespace Logic.Agent
|
|||||||
: Rotation.Left;
|
: Rotation.Left;
|
||||||
break;
|
break;
|
||||||
case AgentAction.GoForward:
|
case AgentAction.GoForward:
|
||||||
StartCoroutine(
|
StartCoroutine(RunToAnotherNode(_currentState.AgentPosition.FindNode(_currentState.AgentRotation)));
|
||||||
RunToAnotherNode(_currentState.AgentPosition.FindNode(_currentState.AgentRotation)));
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//node.Item2?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
isFollowingPath = false;
|
isFollowingPath = false;
|
||||||
|
ClearMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator RotateLeft()
|
private IEnumerator RotateLeft()
|
||||||
@ -160,7 +170,7 @@ namespace Logic.Agent
|
|||||||
float i = 0;
|
float i = 0;
|
||||||
while (i <= 1)
|
while (i <= 1)
|
||||||
{
|
{
|
||||||
Debug.Log(i);
|
// Debug.Log(i);
|
||||||
transform.rotation = Quaternion.Slerp(startRotation, targetRotation, i);
|
transform.rotation = Quaternion.Slerp(startRotation, targetRotation, i);
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
i += Time.deltaTime*3;
|
i += Time.deltaTime*3;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Assets.Logic.Agent;
|
using Logic.Agent;
|
||||||
using Logic.Utils;
|
using Logic.Utils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -9,14 +9,20 @@ namespace Logic.Graph
|
|||||||
{
|
{
|
||||||
public class Node : MonoBehaviour
|
public class Node : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Material nodeMat;
|
|
||||||
public Material pathMat;
|
|
||||||
public List<Node> neighbors;
|
public List<Node> neighbors;
|
||||||
[SerializeField] private float maxRange = 0.5f;
|
[SerializeField] private Material nodeMat;
|
||||||
|
[SerializeField] private Material pathMat;
|
||||||
|
[SerializeField] private Material exploredMat;
|
||||||
[SerializeField] private bool debug = false;
|
[SerializeField] private bool debug = false;
|
||||||
|
[SerializeField] private float movementPenalty;
|
||||||
|
|
||||||
|
|
||||||
|
private readonly float _maxRayRange = 0.75f;
|
||||||
|
private readonly float _maxTableRayRange = 0.5f;
|
||||||
|
private readonly float _maxSphereRange = 0.25f;
|
||||||
private int _nodeLayerMask;
|
private int _nodeLayerMask;
|
||||||
private int _tableLayerMask;
|
private int _tableLayerMask;
|
||||||
|
private int _obstacleLayerMask;
|
||||||
private Vector3 _position;
|
private Vector3 _position;
|
||||||
private float _nodeRayMaxLength;
|
private float _nodeRayMaxLength;
|
||||||
private float _tableRayMaxLength;
|
private float _tableRayMaxLength;
|
||||||
@ -26,20 +32,12 @@ namespace Logic.Graph
|
|||||||
{
|
{
|
||||||
_renderer = GetComponent<Renderer>();
|
_renderer = GetComponent<Renderer>();
|
||||||
InitializeNeighbours();
|
InitializeNeighbours();
|
||||||
|
movementPenalty += SceneContext.Instance.nodeBaseCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
public float GETNodeCost()
|
||||||
{
|
{
|
||||||
if (debug)
|
return movementPenalty;
|
||||||
{
|
|
||||||
Debug.DrawRay(_position, Vector3.right + new Vector3(maxRange, 0, 0), Color.red);
|
|
||||||
Debug.DrawRay(_position, Vector3.left + new Vector3(-maxRange, 0, 0), Color.blue);
|
|
||||||
Debug.DrawRay(_position, Vector3.forward + new Vector3(0, 0, maxRange), Color.green);
|
|
||||||
Debug.DrawRay(_position, Vector3.back + new Vector3(0, 0, -maxRange), Color.magenta);
|
|
||||||
|
|
||||||
Debug.DrawRay(_position, Vector3.right + new Vector3(_tableRayMaxLength, 0, 0), Color.cyan);
|
|
||||||
Debug.DrawRay(_position, Vector3.left + new Vector3(-_tableRayMaxLength, 0, 0), Color.yellow);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MarkAsPath()
|
public void MarkAsPath()
|
||||||
@ -50,6 +48,14 @@ namespace Logic.Graph
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void MarkAsExplored()
|
||||||
|
{
|
||||||
|
if (!gameObject.CompareTag("Table"))
|
||||||
|
{
|
||||||
|
_renderer.material = exploredMat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void ClearPathMark()
|
public void ClearPathMark()
|
||||||
{
|
{
|
||||||
if (!gameObject.CompareTag("Table"))
|
if (!gameObject.CompareTag("Table"))
|
||||||
@ -57,15 +63,82 @@ namespace Logic.Graph
|
|||||||
_renderer.material = nodeMat;
|
_renderer.material = nodeMat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Node FindNode(Rotation agentRotation)
|
||||||
|
{
|
||||||
|
switch (agentRotation)
|
||||||
|
{
|
||||||
|
case Rotation.Left:
|
||||||
|
return neighbors.FirstOrDefault(x =>
|
||||||
|
x.transform.position.z.IsEq(transform.position.z) &&
|
||||||
|
x.transform.position.x.IsEq(transform.position.x - 1));
|
||||||
|
case Rotation.Right:
|
||||||
|
return neighbors.FirstOrDefault(x =>
|
||||||
|
x.transform.position.z.IsEq(transform.position.z) &&
|
||||||
|
x.transform.position.x.IsEq(transform.position.x + 1));
|
||||||
|
case Rotation.Top:
|
||||||
|
return neighbors.FirstOrDefault(x =>
|
||||||
|
x.transform.position.x.IsEq(transform.position.x) &&
|
||||||
|
x.transform.position.z.IsEq(transform.position.z + 1));
|
||||||
|
case Rotation.Bottom:
|
||||||
|
return neighbors.FirstOrDefault(x =>
|
||||||
|
x.transform.position.x.IsEq(transform.position.x) &&
|
||||||
|
x.transform.position.z.IsEq(transform.position.z - 1));
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Debug.DrawRay(_position, Vector3.right + new Vector3(_maxRayRange, 0, 0), Color.red);
|
||||||
|
Debug.DrawRay(_position, Vector3.left + new Vector3(-_maxRayRange, 0, 0), Color.blue);
|
||||||
|
Debug.DrawRay(_position, Vector3.forward + new Vector3(0, 0, _maxRayRange), Color.green);
|
||||||
|
Debug.DrawRay(_position, Vector3.back + new Vector3(0, 0, -_maxRayRange), Color.magenta);
|
||||||
|
|
||||||
|
Debug.DrawRay(_position, Vector3.up + new Vector3(0, _maxRayRange, 0), Color.green);
|
||||||
|
Debug.DrawRay(_position, Vector3.down + new Vector3(0, -_maxRayRange, 0), Color.magenta);
|
||||||
|
|
||||||
|
Debug.DrawRay(_position, Vector3.right + new Vector3(_tableRayMaxLength, 0, 0), Color.cyan);
|
||||||
|
Debug.DrawRay(_position, Vector3.left + new Vector3(-_tableRayMaxLength, 0, 0), Color.yellow);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Gizmos.color = Color.blue;
|
||||||
|
Gizmos.DrawWireSphere(transform.position, _maxSphereRange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void InitializeNeighbours()
|
private void InitializeNeighbours()
|
||||||
{
|
{
|
||||||
_nodeLayerMask = LayerMask.GetMask("Node");
|
_nodeLayerMask = LayerMask.GetMask("Node");
|
||||||
_tableLayerMask = LayerMask.GetMask("Table");
|
_tableLayerMask = LayerMask.GetMask("Table");
|
||||||
|
_obstacleLayerMask = LayerMask.GetMask("Obstacle");
|
||||||
|
|
||||||
_position = gameObject.transform.position;
|
_position = gameObject.transform.position;
|
||||||
_nodeRayMaxLength = maxRange * 2;
|
_nodeRayMaxLength = _maxRayRange * 2;
|
||||||
_tableRayMaxLength = maxRange * 2 + 0.5f;
|
_tableRayMaxLength = _maxRayRange * 2 + 0.5f;
|
||||||
|
|
||||||
|
var colliders = Physics.OverlapSphere(transform.position, _maxSphereRange, _obstacleLayerMask);
|
||||||
|
var obstacleLayer = (int) Math.Log(_obstacleLayerMask, 2);
|
||||||
|
foreach (Collider otherCollider in colliders)
|
||||||
|
{
|
||||||
|
if (otherCollider.gameObject.layer == obstacleLayer)
|
||||||
|
{
|
||||||
|
var obstacle = otherCollider.GetComponent<Obstacle>();
|
||||||
|
var cost = obstacle.GETMovementPenaltyCost();
|
||||||
|
if (cost > movementPenalty)
|
||||||
|
movementPenalty = cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Physics.Raycast(_position, Vector3.left, out var hitLeft, _nodeRayMaxLength, _nodeLayerMask))
|
if (Physics.Raycast(_position, Vector3.left, out var hitLeft, _nodeRayMaxLength, _nodeLayerMask))
|
||||||
{
|
{
|
||||||
var nodeCollider = hitLeft.collider.GetComponent<Node>();
|
var nodeCollider = hitLeft.collider.GetComponent<Node>();
|
||||||
@ -87,14 +160,14 @@ namespace Logic.Graph
|
|||||||
neighbors.Add(nodeCollider);
|
neighbors.Add(nodeCollider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Physics.Raycast(_position, Vector3.back, out var hitBottom, maxRange * 2, _nodeLayerMask))
|
if (Physics.Raycast(_position, Vector3.back, out var hitBottom, _maxRayRange * 2, _nodeLayerMask))
|
||||||
{
|
{
|
||||||
var nodeCollider = hitBottom.collider.GetComponent<Node>();
|
var nodeCollider = hitBottom.collider.GetComponent<Node>();
|
||||||
if (nodeCollider)
|
if (nodeCollider)
|
||||||
neighbors.Add(nodeCollider);
|
neighbors.Add(nodeCollider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Physics.Raycast(_position, Vector3.left, out var hitLeftTable, _tableRayMaxLength, _tableLayerMask))
|
if (Physics.Raycast(_position, Vector3.left, out var hitLeftTable, _maxTableRayRange, _tableLayerMask))
|
||||||
{
|
{
|
||||||
var tableCollider = hitLeftTable.collider.GetComponent<CustomerTable>();
|
var tableCollider = hitLeftTable.collider.GetComponent<CustomerTable>();
|
||||||
if (tableCollider)
|
if (tableCollider)
|
||||||
@ -104,7 +177,7 @@ namespace Logic.Graph
|
|||||||
neighbors.Add(kitchenTableCollider);
|
neighbors.Add(kitchenTableCollider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Physics.Raycast(_position, Vector3.right, out var hitRightTable, _tableRayMaxLength, _tableLayerMask))
|
if (Physics.Raycast(_position, Vector3.right, out var hitRightTable, _maxTableRayRange, _tableLayerMask))
|
||||||
{
|
{
|
||||||
var tableCollider = hitRightTable.collider.GetComponent<CustomerTable>();
|
var tableCollider = hitRightTable.collider.GetComponent<CustomerTable>();
|
||||||
if (tableCollider)
|
if (tableCollider)
|
||||||
@ -113,31 +186,7 @@ namespace Logic.Graph
|
|||||||
if (kitchenTableCollider)
|
if (kitchenTableCollider)
|
||||||
neighbors.Add(kitchenTableCollider);
|
neighbors.Add(kitchenTableCollider);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public Node FindNode(Rotation agentRotation)
|
|
||||||
{
|
|
||||||
switch (agentRotation)
|
|
||||||
{
|
|
||||||
case Rotation.Left:
|
|
||||||
return neighbors.FirstOrDefault(x =>
|
|
||||||
x.transform.position.z.IsEq(transform.position.z) &&
|
|
||||||
x.transform.position.x.IsEq(transform.position.x - 1));
|
|
||||||
case Rotation.Right:
|
|
||||||
return neighbors.FirstOrDefault(x =>
|
|
||||||
x.transform.position.z.IsEq(transform.position.z) &&
|
|
||||||
x.transform.position.x.IsEq(transform.position.x + 1));
|
|
||||||
case Rotation.Top:
|
|
||||||
return neighbors.FirstOrDefault(x =>
|
|
||||||
x.transform.position.x.IsEq(transform.position.x) &&
|
|
||||||
x.transform.position.z.IsEq(transform.position.z + 1.25f));
|
|
||||||
case Rotation.Bottom:
|
|
||||||
return neighbors.FirstOrDefault(x =>
|
|
||||||
x.transform.position.x.IsEq(transform.position.x) &&
|
|
||||||
x.transform.position.z.IsEq(transform.position.z - 1.25f));
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
33
Assets/Logic/Graph/Obstacle.cs
Normal file
33
Assets/Logic/Graph/Obstacle.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Logic.Graph
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum ObstacleType
|
||||||
|
{
|
||||||
|
Bar,
|
||||||
|
Water
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class ObstacleData
|
||||||
|
{
|
||||||
|
public ObstacleType type;
|
||||||
|
public float penalty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Obstacle : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
[SerializeField] private ObstacleType obstacleType;
|
||||||
|
|
||||||
|
public float GETMovementPenaltyCost()
|
||||||
|
{
|
||||||
|
var obstacleData = SceneContext.Instance.obstacles.First(x => x.type == obstacleType);
|
||||||
|
return obstacleData.penalty;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
3
Assets/Logic/Graph/Obstacle.cs.meta
Normal file
3
Assets/Logic/Graph/Obstacle.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d9978794eb6647e2972119f5cdf214d6
|
||||||
|
timeCreated: 1619115607
|
@ -9,9 +9,13 @@ namespace Logic
|
|||||||
public class SceneContext : MonoBehaviour
|
public class SceneContext : MonoBehaviour
|
||||||
{
|
{
|
||||||
public List<Node> map;
|
public List<Node> map;
|
||||||
|
public ObstacleData[] obstacles;
|
||||||
|
public float nodeBaseCost;
|
||||||
|
public float rotationCost;
|
||||||
|
public bool useAStar = true;
|
||||||
public static SceneContext Instance;
|
public static SceneContext Instance;
|
||||||
|
|
||||||
void Start()
|
void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
Application.targetFrameRate = 144;
|
Application.targetFrameRate = 144;
|
||||||
@ -44,4 +48,5 @@ namespace Logic
|
|||||||
DrawGizmosFrom(map.First(), new List<Node>());
|
DrawGizmosFrom(map.First(), new List<Node>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
110
Assets/Logic/Utils/Heap.cs
Normal file
110
Assets/Logic/Utils/Heap.cs
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Logic.Utils
|
||||||
|
{
|
||||||
|
public class Heap<T> where T : IHeapItem<T>
|
||||||
|
{
|
||||||
|
protected readonly T[] Items;
|
||||||
|
private int _currentItemCount;
|
||||||
|
|
||||||
|
protected Heap(int maxHeapSize)
|
||||||
|
{
|
||||||
|
Items = new T[maxHeapSize];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Enqueue(T item)
|
||||||
|
{
|
||||||
|
item.HeapIndex = _currentItemCount;
|
||||||
|
Items[_currentItemCount] = item;
|
||||||
|
SortUp(item);
|
||||||
|
_currentItemCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Dequeue()
|
||||||
|
{
|
||||||
|
T firstItem = Items[0];
|
||||||
|
_currentItemCount--;
|
||||||
|
Items[0] = Items[_currentItemCount];
|
||||||
|
Items[0].HeapIndex = 0;
|
||||||
|
SortDown(Items[0]);
|
||||||
|
return firstItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateItem(T item, int index)
|
||||||
|
{
|
||||||
|
item.HeapIndex = index;
|
||||||
|
Items[index] = item;
|
||||||
|
SortUp(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Count => _currentItemCount;
|
||||||
|
|
||||||
|
private void SortDown(T item)
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
int childIndexLeft = item.HeapIndex * 2 + 1;
|
||||||
|
int childIndexRight = item.HeapIndex * 2 + 2;
|
||||||
|
int swapIndex = 0;
|
||||||
|
if (childIndexLeft < _currentItemCount)
|
||||||
|
{
|
||||||
|
swapIndex = childIndexLeft;
|
||||||
|
if (childIndexRight < _currentItemCount)
|
||||||
|
{
|
||||||
|
if (Items[childIndexLeft].CompareTo(Items[childIndexRight]) < 0)
|
||||||
|
{
|
||||||
|
swapIndex = childIndexRight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.CompareTo(Items[swapIndex]) < 0)
|
||||||
|
{
|
||||||
|
Swap(item, Items[swapIndex]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SortUp(T item)
|
||||||
|
{
|
||||||
|
int parentIndex = (item.HeapIndex - 1) / 2;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
T parentItem = Items[parentIndex];
|
||||||
|
if (item.CompareTo(parentItem) > 0)
|
||||||
|
{
|
||||||
|
Swap(item, parentItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
parentIndex = (item.HeapIndex - 1) / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Swap(T itemA, T itemB)
|
||||||
|
{
|
||||||
|
Items[itemA.HeapIndex] = itemB;
|
||||||
|
Items[itemB.HeapIndex] = itemA;
|
||||||
|
int itemAIndex = itemA.HeapIndex;
|
||||||
|
itemA.HeapIndex = itemB.HeapIndex;
|
||||||
|
itemB.HeapIndex = itemAIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface IHeapItem<T> : IComparable<T>
|
||||||
|
{
|
||||||
|
int HeapIndex { get; set; }
|
||||||
|
}
|
||||||
|
}
|
3
Assets/Logic/Utils/Heap.cs.meta
Normal file
3
Assets/Logic/Utils/Heap.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 92f8dbe7c78e4a119f67c2ce3b6a4b5f
|
||||||
|
timeCreated: 1619189961
|
@ -1,327 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!1 &2565656631509715975
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 2473193917118609049}
|
|
||||||
- component: {fileID: 7006137836792006186}
|
|
||||||
- component: {fileID: 2840615025101563930}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Box003 1 (1)
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &2473193917118609049
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2565656631509715975}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -0.112, y: 0, z: -0.003}
|
|
||||||
m_LocalScale: {x: 0.25, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 8414219303661129664}
|
|
||||||
m_RootOrder: 3
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!33 &7006137836792006186
|
|
||||||
MeshFilter:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2565656631509715975}
|
|
||||||
m_Mesh: {fileID: -7879699026112601197, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
--- !u!23 &2840615025101563930
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2565656631509715975}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 2
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2895064947943234598, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 3
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
|
||||||
--- !u!1 &4531242527359874286
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 3616825550709111917}
|
|
||||||
- component: {fileID: 6590821551394932748}
|
|
||||||
- component: {fileID: 4193079779083189544}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Box003 1 (2)
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &3616825550709111917
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 4531242527359874286}
|
|
||||||
m_LocalRotation: {x: -0, y: -0, z: 0.7071069, w: 0.70710677}
|
|
||||||
m_LocalPosition: {x: 0, y: 0.07, z: -0.003}
|
|
||||||
m_LocalScale: {x: 0.25, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 8414219303661129664}
|
|
||||||
m_RootOrder: 4
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!33 &6590821551394932748
|
|
||||||
MeshFilter:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 4531242527359874286}
|
|
||||||
m_Mesh: {fileID: -7879699026112601197, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
--- !u!23 &4193079779083189544
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 4531242527359874286}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 2
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2895064947943234598, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 3
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
|
||||||
--- !u!1 &9151519995397422379
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1890587839847572155}
|
|
||||||
- component: {fileID: 6405327285881159784}
|
|
||||||
- component: {fileID: 3922519392278820502}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Box001 1 (1)
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &1890587839847572155
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 9151519995397422379}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: -0.112, y: 3.215206e-13, z: -0.50625}
|
|
||||||
m_LocalScale: {x: 0.25, y: 1, z: 0.5}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 8414219303661129664}
|
|
||||||
m_RootOrder: 2
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!33 &6405327285881159784
|
|
||||||
MeshFilter:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 9151519995397422379}
|
|
||||||
m_Mesh: {fileID: -2854964736626054917, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
--- !u!23 &3922519392278820502
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 9151519995397422379}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 2
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2895064947943234598, guid: 021e9ec88d16b31458032ba2efa8a8f8, type: 3}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 3
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
|
||||||
--- !u!1001 &9080035227615361422
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 0.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 1.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 0.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: -0.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0.5
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: -90
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 90
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1228394963740553586, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: BarCorner
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4444703243637854825, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 0.25
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4444703243637854825, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0.118
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 9126687368945354593, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 0.25
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 9126687368945354593, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0.118
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 9126687368945354593, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: -0.506
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
--- !u!4 &8414219303661129664 stripped
|
|
||||||
Transform:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 776743453089281614, guid: 37a2c2f2937091f408bc4a7f9e5923b2, type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 9080035227615361422}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
@ -1,71 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!1001 &6001426303718084572
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 2262144220064471084, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_Enabled
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 3306161798889408701, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 0.35
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4775359161287261870, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: BarShort
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 0.7071068
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: -0.7071068
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: -90
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6453329937250285970, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7991526901279808949, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 0.36
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: a1cb481af773f3c45bda8f2d5f1c0075, type: 3}
|
|
@ -10,8 +10,9 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 6453329937250285970}
|
- component: {fileID: 6453329937250285970}
|
||||||
- component: {fileID: 8315836113623620561}
|
- component: {fileID: 8315836113623620561}
|
||||||
m_Layer: 0
|
- component: {fileID: 7059161905270609152}
|
||||||
m_Name: Bar
|
m_Layer: 9
|
||||||
|
m_Name: BarObstacle
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@ -46,6 +47,19 @@ BoxCollider:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &7059161905270609152
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4775359161287261870}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d9978794eb6647e2972119f5cdf214d6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
obstacleType: 0
|
||||||
--- !u!1 &7458537012890967998
|
--- !u!1 &7458537012890967998
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -57,7 +71,7 @@ GameObject:
|
|||||||
- component: {fileID: 7991526901279808949}
|
- component: {fileID: 7991526901279808949}
|
||||||
- component: {fileID: 1683996547186378934}
|
- component: {fileID: 1683996547186378934}
|
||||||
- component: {fileID: 2262144220064471084}
|
- component: {fileID: 2262144220064471084}
|
||||||
m_Layer: 0
|
m_Layer: 9
|
||||||
m_Name: Box003 1
|
m_Name: Box003 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -72,8 +86,8 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 7458537012890967998}
|
m_GameObject: {fileID: 7458537012890967998}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: 0.7071069, w: 0.70710677}
|
m_LocalRotation: {x: -0, y: -0, z: 0.7071069, w: 0.70710677}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -0.003}
|
m_LocalPosition: {x: -0.000000017881, y: 0, z: -0.003}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 0.32, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 6453329937250285970}
|
m_Father: {fileID: 6453329937250285970}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
@ -138,7 +152,7 @@ GameObject:
|
|||||||
- component: {fileID: 3306161798889408701}
|
- component: {fileID: 3306161798889408701}
|
||||||
- component: {fileID: 6386406479627342688}
|
- component: {fileID: 6386406479627342688}
|
||||||
- component: {fileID: 6930241759494944571}
|
- component: {fileID: 6930241759494944571}
|
||||||
m_Layer: 0
|
m_Layer: 9
|
||||||
m_Name: Box001 1
|
m_Name: Box001 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -153,8 +167,8 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8706372573158961954}
|
m_GameObject: {fileID: 8706372573158961954}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: 0.7071069, w: 0.70710677}
|
m_LocalRotation: {x: -0, y: -0, z: 0.7071069, w: 0.70710677}
|
||||||
m_LocalPosition: {x: -0.00000011921, y: 3.215206e-13, z: -0.50625}
|
m_LocalPosition: {x: -0.00000059678, y: -0.00000044656, z: -0.50938}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 0.5}
|
m_LocalScale: {x: 0.315, y: 1, z: 0.50625}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 6453329937250285970}
|
m_Father: {fileID: 6453329937250285970}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
@ -46,11 +46,12 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: c774c22d330c32f48bfaca0426c29ad5, type: 3}
|
m_Script: {fileID: 11500000, guid: c774c22d330c32f48bfaca0426c29ad5, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
neighbors: []
|
||||||
nodeMat: {fileID: 2100000, guid: bc3e8f6bac7842c4ab76e3b39f31a353, type: 2}
|
nodeMat: {fileID: 2100000, guid: bc3e8f6bac7842c4ab76e3b39f31a353, type: 2}
|
||||||
pathMat: {fileID: 2100000, guid: 1293cff8126771046a5a69f1aa772d65, type: 2}
|
pathMat: {fileID: 2100000, guid: 1293cff8126771046a5a69f1aa772d65, type: 2}
|
||||||
neighbors: []
|
exploredMat: {fileID: 2100000, guid: 9ac24eaf07a787147878b53b3ef377bc, type: 2}
|
||||||
maxRange: 0.75
|
|
||||||
debug: 0
|
debug: 0
|
||||||
|
movementPenalty: 0
|
||||||
--- !u!23 &5273760715526374001
|
--- !u!23 &5273760715526374001
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -186,7 +186,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2381946650362024112}
|
m_GameObject: {fileID: 2381946650362024112}
|
||||||
m_LocalRotation: {x: -0.00000019949603, y: 0.7071068, z: 0.7071068, w: 0.00000019949603}
|
m_LocalRotation: {x: -0.00000019949603, y: 0.7071068, z: 0.7071068, w: 0.00000019949603}
|
||||||
m_LocalPosition: {x: 0, y: -0.018, z: 0.425}
|
m_LocalPosition: {x: 0, y: 0.003, z: 0.301}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 7930305233008882851}
|
- {fileID: 7930305233008882851}
|
||||||
@ -336,11 +336,12 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 682c70c355804410af55074b0d8c0a88, type: 3}
|
m_Script: {fileID: 11500000, guid: 682c70c355804410af55074b0d8c0a88, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
neighbors: []
|
||||||
nodeMat: {fileID: 0}
|
nodeMat: {fileID: 0}
|
||||||
pathMat: {fileID: 0}
|
pathMat: {fileID: 0}
|
||||||
neighbors: []
|
exploredMat: {fileID: 0}
|
||||||
maxRange: 0.1
|
|
||||||
debug: 0
|
debug: 0
|
||||||
|
movementPenalty: 0
|
||||||
recipePrefab: {fileID: 1685343955664076, guid: 72653085a6b827f48b10b434c7972f1c, type: 3}
|
recipePrefab: {fileID: 1685343955664076, guid: 72653085a6b827f48b10b434c7972f1c, type: 3}
|
||||||
moneyPrefab: {fileID: 1950871307682000, guid: 01348926c7cbb3347a006c37204131c3, type: 3}
|
moneyPrefab: {fileID: 1950871307682000, guid: 01348926c7cbb3347a006c37204131c3, type: 3}
|
||||||
spawnPoint: {fileID: 5331314718952806374}
|
spawnPoint: {fileID: 5331314718952806374}
|
||||||
@ -702,7 +703,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8350420071825697581}
|
m_GameObject: {fileID: 8350420071825697581}
|
||||||
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||||
m_LocalPosition: {x: 0, y: -0.01, z: -0.376}
|
m_LocalPosition: {x: 0, y: 0.016, z: -0.218}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 6488503019443644745}
|
- {fileID: 6488503019443644745}
|
||||||
|
112
Assets/Prefabs/Map/Smart/WaterObstacle.prefab
Normal file
112
Assets/Prefabs/Map/Smart/WaterObstacle.prefab
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &409510081860761508
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2485448935862418815}
|
||||||
|
- component: {fileID: 8275326148080597472}
|
||||||
|
- component: {fileID: 2937641931314369368}
|
||||||
|
- component: {fileID: 2767194014693675629}
|
||||||
|
m_Layer: 9
|
||||||
|
m_Name: WaterObstacle
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2485448935862418815
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 409510081860761508}
|
||||||
|
m_LocalRotation: {x: 0.70710576, y: -0, z: -0, w: 0.70710784}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||||
|
--- !u!212 &8275326148080597472
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 409510081860761508}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_Sprite: {fileID: 7482667652216324306, guid: db750325989564987a34393247d883b4, type: 3}
|
||||||
|
m_Color: {r: 0.20518868, g: 0.6832181, b: 0.8207547, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1, y: 1}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!114 &2937641931314369368
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 409510081860761508}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d9978794eb6647e2972119f5cdf214d6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
obstacleType: 1
|
||||||
|
--- !u!65 &2767194014693675629
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 409510081860761508}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 1, y: 1, z: 0.01}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 37a2c2f2937091f408bc4a7f9e5923b2
|
guid: c5bd8bcb1700f1b48afa7a31549fd36d
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,7 @@ TagManager:
|
|||||||
- Walls
|
- Walls
|
||||||
- Node
|
- Node
|
||||||
- Table
|
- Table
|
||||||
-
|
- Obstacle
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
|
Loading…
Reference in New Issue
Block a user