forked from Angus-Fan/TurnBasedStrategyGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts that are used in the project
- Loading branch information
Showing
9 changed files
with
2,630 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class ClickableTileScript : MonoBehaviour | ||
{ | ||
//The x and y co-ordinate of the tile | ||
public int tileX; | ||
public int tileY; | ||
//The unit on the tile | ||
public GameObject unitOnTile; | ||
public tileMapScript map; | ||
|
||
|
||
/* | ||
* This was used in Quill18Create'sTutorial, I no longer use this portion | ||
private void OnMouseDown() | ||
{ | ||
Debug.Log("tile has been clicked"); | ||
if (map.selectedUnit != null) | ||
{ | ||
map.generatePathTo(tileX, tileY); | ||
} | ||
}*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Node { | ||
|
||
public List<Node> neighbours; | ||
public int x; | ||
public int y; | ||
//Edges | ||
public Node() | ||
{ | ||
neighbours = new List<Node>(); | ||
} | ||
|
||
public float DistanceTo(Node n) | ||
{ | ||
return Vector2.Distance(new Vector2(x, y), new Vector2(n.x, n.y)); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
[System.Serializable] | ||
public class Tile | ||
{ | ||
|
||
public string name; | ||
public GameObject tileVisualPrefab; | ||
public GameObject unitOnTile; | ||
public float movementCost = 1; | ||
public bool isWalkable=true; | ||
|
||
/* | ||
private int x; | ||
private int y; | ||
public Tile( int xLocation, int yLocation) | ||
{ | ||
x = xLocation; | ||
y = yLocation; | ||
} | ||
public void setCoords(int xLocation, int yLocation) | ||
{ | ||
x = xLocation; | ||
y = yLocation; | ||
} | ||
*/ | ||
} |
Oops, something went wrong.