private void Start() { //Setting up the singleton Instance = this; //Get the transform of the human character humanInvokingPosition = GetComponent <GameInstance>().Player_Components.invokingPosition; //Setup color inactiveColor = new Color(1, 1, 1, inactiveAlpha); //Setup the transform positions prevStaticPosition = uiElements.previousGadget_IMG.gameObject.GetComponent <RectTransform>().anchoredPosition; curStaticPosition = uiElements.currentGadget_IMG.gameObject.GetComponent <RectTransform>().anchoredPosition; nextStaticPosition = uiElements.nextGadget_IMG.gameObject.GetComponent <RectTransform>().anchoredPosition; prevStaticSize = uiElements.previousGadget_IMG.gameObject.GetComponent <RectTransform>().sizeDelta; curStaticSize = uiElements.currentGadget_IMG.gameObject.GetComponent <RectTransform>().sizeDelta; nextStaticSize = uiElements.nextGadget_IMG.gameObject.GetComponent <RectTransform>().sizeDelta; prevTransform = uiElements.previousGadget_IMG.gameObject.GetComponent <RectTransform>(); curTransform = uiElements.currentGadget_IMG.gameObject.GetComponent <RectTransform>(); nextTransform = uiElements.nextGadget_IMG.gameObject.GetComponent <RectTransform>(); //Add appropriate items to the inventory. !DebugMode = Hands, otherwise everything AddItemsToInventory(); //Set the images to null. In the main menu there are some placeholder graphics for lazyness' sake uiElements.previousGadget_IMG.sprite = null; uiElements.currentGadget_IMG.sprite = null; uiElements.nextGadget_IMG.sprite = null; uiElements.previousGadget_IMG.color = transparentColor; uiElements.currentGadget_IMG.color = transparentColor; uiElements.nextGadget_IMG.color = transparentColor; if (allGadgets.Length > 0 && storedGadgets.Count > 0) { uiElements.currentGadget_IMG.sprite = storedGadgets[0].icon; uiElements.previousGadget_IMG.sprite = GetPrevGadget(0).icon; uiElements.nextGadget_IMG.sprite = GetNextGadget(0).icon; if (uiElements.currentGadget_IMG.sprite) { uiElements.currentGadget_IMG.color = Color.white; } if (uiElements.previousGadget_IMG.sprite) { uiElements.previousGadget_IMG.color = Color.white; } if (uiElements.nextGadget_IMG.sprite) { uiElements.nextGadget_IMG.color = Color.white; } } }
private void Awake() { //Initialize Singleton Instance = this; //Subscribe functions to static events SwitchControl.Switched += ToggleInventoryVisibility; SwitchControl.Switched += ChangeHuman; SwitchControl.Switched += DemarkTarget; InputManager.ButtonPress += HandleInput; }
private void Start() { inventory = GadgetInventory.Instance; }