Science Manager and Galaxy merging
This commit is contained in:
@@ -5,16 +5,22 @@ using System.Dynamic;
|
||||
using System.Reflection.Emit;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class ScienceManager : MonoBehaviour
|
||||
{
|
||||
{
|
||||
|
||||
public int ScienceCostCurrentTech;
|
||||
public GameObject ScienceUI;
|
||||
public Text AccScienceLabel;
|
||||
//public Text AccScienceLabel;
|
||||
|
||||
public static int TechnologiesTotal = 4;
|
||||
public Tech[] techs = new Tech[TechnologiesTotal];
|
||||
|
||||
|
||||
public GameObject[] objectsToDeactivate;
|
||||
public GameObject[] objectsToActivate;
|
||||
public string SceneName;
|
||||
private bool ScineActiveState = true;
|
||||
public Text CostText;
|
||||
public Text[] TechQueueUIArr = new Text[4];
|
||||
public Text[] TechLevelLabels = new Text[4];
|
||||
@@ -34,6 +40,8 @@ public class ScienceManager : MonoBehaviour
|
||||
UpdateScience(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
@@ -52,7 +60,30 @@ public class ScienceManager : MonoBehaviour
|
||||
{
|
||||
ScienceUI.SetActive(true);
|
||||
}
|
||||
if (ScineActiveState)
|
||||
{
|
||||
ScineActiveState = false;
|
||||
for (int i = 0; i < objectsToDeactivate.Length; i++)
|
||||
{
|
||||
objectsToDeactivate[i].SetActive(false); // deactivate the game object
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ScineActiveState = true;
|
||||
for (int i = 0; i < objectsToActivate.Length; i++)
|
||||
{
|
||||
objectsToActivate[i].SetActive(true); // activate the game object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To change the scene by name
|
||||
public void ChangeScene()
|
||||
{
|
||||
SceneManager.LoadScene(SceneName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// increase tech level
|
||||
/// reduce acumulated Science
|
||||
@@ -182,7 +213,7 @@ public class ScienceManager : MonoBehaviour
|
||||
public void UpdateScienceUI()
|
||||
{
|
||||
UpdateQueueText();
|
||||
AccScienceLabel.text = ScienceAcumulated.ToString();
|
||||
//AccScienceLabel.text = ScienceAcumulated.ToString();
|
||||
for (int i = 0; i < TechLevelLabels.Length; i++)
|
||||
{
|
||||
TechLevelLabels[i].text = techs[i].Level.ToString();
|
||||
|
||||
Reference in New Issue
Block a user