This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour { | |
//Creates a public static variable for the GameManager class | |
//A static class will mean that any changes made to the GameManager will affect all copies of the variable | |
public static GameManager instance; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour { | |
// Creates a public static variable for the GameManager class | |
// A static class will mean that any changes made to the GameManager will affect all copies of the variable | |
public static GameManager instance; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour { | |
// Creates a public static variable for the GameManager class | |
// A static class will mean that any changes made to the GameManager will affect all copies of the variable | |
public static GameManager instance; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour | |
{ | |
// Creates a public static variable for the GameManager class | |
// A static class will mean that any changes made to the GameManager will affect all copies of the variable |
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
public class barScale : MonoBehaviour { | |
public stats shipStats; | |
public int maxStat; | |
public string type; | |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TextAdventure | |
{ | |
class Exit | |
{ |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour | |
{ | |
public static GameManager gm; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class GameManager : MonoBehaviour | |
{ | |
public static GameManager gm; |
This file contains hidden or 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
foreach userUnit u | |
userUnit target | |
pathTarget = u.node | |
if indexOf u.node + 1 <= movement + 1 | |
bool inRange = true | |
if inRange | |
List<UserUnit> UnitsInRange | |
This file contains hidden or 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
public override void turnUpdate() | |
{ | |
//A boolean added in preparation, should it be required | |
findUnits = true; | |
//I created a List within the GameManager to store specifically User Units, allowing the AI to loop through them | |
foreach (UserUnit u in gm.userUnits) | |
{ | |
//The path target is set to the unit, creating a path from the AI Unit to the User Unit | |
path.target.transform.position = u.currentTile._pos; | |
//A debug log to ensure results were being picked up correctly |
OlderNewer