A Point of Reference
So this is my script for ending a turn
public static TurnOrderScript Instance { get; private set; }
public void TestEndTurn(int turnOrder)
{
int TurnOrderScript;
int v = TurnOrderScript = 0;
if (v == 0)
{
turnOrder++;
}
else if (TurnOrderScript == 1)
{
turnOrder = 0;
}
}
IM REFERENCING THIS SCRIPT
public class TurnOrderScript : MonoBehaviour
{
public static TurnOrderScript Instance { get; private set; }
public List<GameObject> turnOrder = new List<GameObject>();
public bool battleStarted;
public void Awake()
{
//"GameController" Dependent Addition
if (this.tag != "GameController")
{
Debug.Log("PartyManager on wrong GameObject!");
Instance = GameObject.FindGameObjectWithTag("GameController").AddComponent<TurnOrderScript>();
Debug.Log("PartyManager moved to GameController");
Destroy(this);
}
//
//Normal Singleton
if (Instance != null && Instance != this)
{
Destroy(this);
}
else
{
Instance = this;
}
//
}
public void GatherUnits(List<GameObject> unitParty)
{
if (battleStarted == false)
{
//Debuging
List<GameObject> partyHolder = new List<GameObject>();
foreach (GameObject unit in unitParty)
{
GameObject unitClone = Instantiate(unit, transform.position, transform.rotation); //
partyHolder.Add(unitClone);
}
//
Debug.Log("Battle Start!");
battleStarted = true;
turnOrder.AddRange(partyHolder);
turnOrder.AddRange(PartyManager.Instance.partyList);
OrderByDiceRoll();
}
}
public void OrderByDiceRoll()
{
foreach (var unit in turnOrder)
{
unit.GetComponent<UnitCharacter>().characterProfile.RollDice();
}
turnOrder = turnOrder.OrderBy(x => x.GetComponent<UnitCharacter>().characterProfile.diceRoll).ToList();
turnOrder.Reverse();
}
}
Nothing is showing up here. In Theory all of this should work, right?
Im new to unity and looking to make an RPG, so there may be some obvious things that look simple to the average coder.