Hello all,
I am relatively new to the Unity Canvas system. In the current game we are creating, we have multiple menus for player upgrades, inventory, and quest hub. I was wondering if there is an easier way to construct the menus with the canvas system to keep them prefabbed and connected rather than building a giant script for functionality and having to reconnect it every time it is moved to another scene or manipulated. Can I add the functionality to the canvas itself if its SetActive state keeps being manipulated? Ill post the top of my script to show all of the connection that the town currently has. Should this be broken down further into smaller scripts or should be fine as is?
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// This script is for the functionality of the port. It handles the switching between screens and the functionality of buying
/// an upgrade.
/// </summary>
public class PortFunctionality : MonoBehaviour
[Header("Script Links")]
public PauseMenu pause;
public StatsHandler stats;
public ShipMovement shipMovement;
public PlayerHealth health;
[Header("Header Text Object")] //Header text of the upgrade screen. Can be manipulated to change per screen.
public Text headerText;
[Header("Window Objects")] //Port Windows. Main Port/Upgrade Window/Quest Window. All screens are seperate.
public GameObject portWindow;
public GameObject upgradeWindow;
public GameObject questWindow;
[Header("Upgrade Windows")] //Upgrade Window with different tabs per skill.
public GameObject introWindow;
public GameObject dmgUpgradeWindow;
public GameObject armorUpgradeWindow;
public GameObject speedUpgradeWindow;
[Header("Damage Upgrades")] //Upgrade slot for each upgrade.
public GameObject damageOneBlock;
public GameObject damageTwoBlock;
public GameObject damageThreeBlock;
[Header("Armor Upgrades")] //Upgrade slot for each upgrade.
public GameObject armorOneBlock;
public GameObject armorTwoBlock;
public GameObject armorThreeBlock;
[Header("Speed Upgrades")] //Upgrade slot for each upgrade.
public GameObject speedOneBlock;
public GameObject speedTwoBlock;
public GameObject speedThreeBlock;