private void Start() { cameraObject = GameObject.Find("Main Camera").GetComponent <AudioManager>(); hbM = FindObjectOfType <HotbarManager>(); itD = FindObjectOfType <ItemDictionary>(); itemSprite = gameObject.GetComponent <SpriteRenderer>(); }
private void SetInstance() { if (instance == null) { instance = this; } }
// Use this for initialization void Awake() { _plantationParent = new GameObject("PlantationParent"); //_upgradeManager = FindObjectOfType<PlantationUpgradeManager>(); _gameController = FindObjectOfType <GameController>(); _hotbarManager = FindObjectOfType <HotbarManager>(); SpawnPlantation(_spawnLocation); _toPlace.enabled = true; _toPlace = null; _currencyManager = FindObjectOfType <CurrencyManager>(); /*_upgradeManager.HealthUpgraded += UpgradeHealth; * _upgradeManager.LPSUpgraded += UpgradeLPS; * _upgradeManager.RegenUpgraded += UpgradeRegen; * _upgradeManager.LeavesUpgraded += (upgrade) => { * _selectedPlantation.TeaLeafValue = (int)upgrade.Value; * _selectedPlantation.TeaLeafColour = upgrade.Colour; * };*/ GetComponent <Button>().onClick.AddListener(() => { if (CanPlacePlantation() && _currencyManager.Spend(TEA_PLANTATION_COST)) { SpawnPlantation(Camera.main.ScreenToWorldPoint(Input.mousePosition)); } }); }
private void Start() { Time.timeScale = 1f; canMove = true; rb = GetComponent <Rigidbody2D>(); hbM = GameObject.Find("HotbarManager").GetComponent <HotbarManager>(); anim = gameObject.GetComponent <Animator>(); knockBackPoint = GameObject.Find("PlayerReturnPoint"); }
private void Start() { aus = gameObject.transform.GetComponent <AudioSource>(); if (isNPC) { questMarker = gameObject.transform.parent.GetChild(2).GetComponent <Sprite>(); } hbM = FindObjectOfType <HotbarManager>(); QM = FindObjectOfType <QuestManager>(); }
void UpdateHotbar() { int newSelection = HotbarManager.GetSelected(); //Surely a better way if (Input.GetKeyDown(KeyCode.Alpha1)) { newSelection = 0; } if (Input.GetKeyDown(KeyCode.Alpha2)) { newSelection = 1; } if (Input.GetKeyDown(KeyCode.Alpha3)) { newSelection = 2; } if (Input.GetKeyDown(KeyCode.Alpha4)) { newSelection = 3; } if (Input.GetKeyDown(KeyCode.Alpha5)) { newSelection = 4; } if (Input.GetKeyDown(KeyCode.Alpha6)) { newSelection = 5; } if (Input.GetKeyDown(KeyCode.Alpha7)) { newSelection = 6; } if (Input.GetKeyDown(KeyCode.Alpha8)) { newSelection = 7; } if (Input.GetKeyDown(KeyCode.Alpha9)) { newSelection = 8; } //Mouse wheel if (Input.GetAxis("Mouse ScrollWheel") > 0f) { newSelection--; } if (Input.GetAxis("Mouse ScrollWheel") < 0f) { newSelection++; } HotbarManager.SetSelected(newSelection); }
private void Awake() { gameTileManager = setTileManager; character = setCharacter; inventoryManager = setInventoryManager; hotbarManager = setHotbarManager; cropsTileManager = setCropsTileManager; dateManager = setDateManager; questManager = setQuestManager; relationshipManager = setRelationshipManager; skillsManager = setSkillsManager; dialogueManager = setDialogueManager; explorationManager = setExplorationManager; }
public void InventoryRemove(Item item) => HotbarManager.RemoveItem(selectedItem);
public void InventoryAdd(Item item) => HotbarManager.AddItem(item);
public override void Interact() { HotbarManager.AddItem(this); gameObject.SetActive(false); }
void Start() { hbM = FindObjectOfType <HotbarManager>().GetComponent <HotbarManager>(); }
void Awake() { _hotbarManager = FindObjectOfType <HotbarManager>(); _currencyManager = FindObjectOfType <CurrencyManager>(); }