Skip to content

Commit 32bb487

Browse files
committed
renamed folder from A_STAR to SCRIPTS
1 parent b1ae6d6 commit 32bb487

20 files changed

+1547
-0
lines changed

Assets/Scripts.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Node.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class Node
6+
{
7+
public Vector3 pos;
8+
public bool unwalkable;
9+
public float G = 0f;
10+
public float H = 0f;
11+
public float F = 0f;
12+
13+
14+
public Node(Vector3 pos, bool unwalkable)
15+
{
16+
17+
18+
this.pos = pos;
19+
this.unwalkable = unwalkable;
20+
}
21+
public float f_cost
22+
{
23+
24+
get { return F; }
25+
set { F = value; }
26+
}public float H_cost
27+
{
28+
29+
get { return F; }
30+
set { F = value; }
31+
}public float G_cost
32+
{
33+
34+
get { return F; }
35+
set { F = value; }
36+
}
37+
38+
public override bool Equals(object obj)
39+
{
40+
Node node = obj as Node;
41+
if (node == null)
42+
return false;
43+
44+
return node.pos == pos;
45+
}
46+
47+
public override int GetHashCode()
48+
{
49+
unchecked
50+
{
51+
int hash = 13;
52+
hash = hash * 27 + pos.x.GetHashCode();
53+
hash = hash * 27 + pos.y.GetHashCode();
54+
hash = hash * 27 + pos.z.GetHashCode();
55+
56+
57+
return hash;
58+
}
59+
60+
61+
62+
}
63+
64+
public override string ToString()
65+
{
66+
return base.ToString();
67+
}
68+
}

Assets/Scripts/Node.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)