Esempio n. 1
0
 void ComponentCheck()
 {
     if (actionBarScript == null)
     {
         actionBarScript = FindObjectOfType <ActionBarScript>();
     }
     if (cinemachine == null)
     {
         cinemachine = FindObjectOfType <Cinemachine.CinemachineVirtualCamera>();
     }
     if (battleUIScript == null)
     {
         battleUIScript = FindObjectOfType <BattleUIScript>();
     }
     if (uIHandlerScript == null)
     {
         uIHandlerScript = FindObjectOfType <UIHandlerScript>();
     }
     if (questManager == null)
     {
         questManager = GetComponent <QuestManager>();
     }
     if (playerManager == null)
     {
         playerManager = FindObjectOfType <PlayerManagerScript>();
     }
 }
Esempio n. 2
0
 // Start is called before the first frame update
 void Awake()
 {
     turnOrder = FindObjectOfType <TurnOrder>();
     if (!turnOrder)
     {
         Debug.LogError("Scene has a game manager script but no turn order");
     }
     uiScript = FindObjectOfType <BattleUIScript>();
     if (!uiScript)
     {
         Debug.LogError("Scene has a game manager script but no ui script");
     }
     board = FindObjectOfType <BoardGenerator>();
     if (!board)
     {
         Debug.LogError("Scene has a game manager script but no board");
     }
     instance = this;
     //Inventory Variables
     inventoryUICanvas = GameObject.FindGameObjectWithTag("InventoryUICanvas");
     if (!inventoryUICanvas)
     {
         Debug.LogError("Scene has a game manager but no inventory UI");
     }
     else
     {
         inventoryUICanvas.SetActive(false); //defaults inventory to closed
     }
     //End Screen Variables
     endScreenUICanvas = GameObject.FindGameObjectWithTag("EndScreenUI");
     if (!endScreenUICanvas)
     {
         Debug.LogError("Scene has a game manager but no end screen UI");
     }
     endUIController = FindObjectOfType <EndUIController>();
     if (!endUIController)
     {
         Debug.LogError("Scene has no end UI Controller");
     }
     else
     {
         endUIController.gameObject.SetActive(false);
     }
     clicker         = FindObjectOfType <Clicker>();
     m_battleManager = gameObject.AddComponent <BattleManager>();
     if (!m_battleManager)
     {
         Debug.LogError("Battle Manager Creation Failed");
     }
 }
 public void attachUIScript(BattleUIScript givenScript)
 {
     uiScript = givenScript;
 }