StarSystem
Stars With switching positions (Bought stars are not saved or shown)
This commit is contained in:
@@ -33,6 +33,12 @@ public class NoPlayablePlayer : Player
|
||||
diceScript = dice.GetComponent<Dice>();
|
||||
}
|
||||
|
||||
public void BuyStar()
|
||||
{
|
||||
GameObject.Find("StarPositions").GetComponent<StarController>().SwitchStar();
|
||||
AddCoins(-20);
|
||||
}
|
||||
|
||||
public void CoinFieldAction(int action)
|
||||
{
|
||||
if (action == 0)
|
||||
@@ -153,4 +159,23 @@ public class NoPlayablePlayer : Player
|
||||
}
|
||||
}
|
||||
|
||||
private Star currentStar;
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (collider.name.Equals("ItemShopTrigger"))
|
||||
{
|
||||
base.OnTriggerEnter(collider);
|
||||
}
|
||||
else if (collider.name.Equals("StarTrigger"))
|
||||
{
|
||||
currentStar = collider.GetComponent<Star>();
|
||||
|
||||
if(currentStar.IsActive)
|
||||
{
|
||||
base.OnTriggerEnter(collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user