void Update() { mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition); MovingCameraInHouse(); if (Input.GetMouseButtonDown(0)) { if (Physics.Raycast(mouseRay, out selection, 200f, canSelect)) { IInteracting interacting = selection.transform.GetComponent <IInteracting>(); if (interacting != null) { interacting.Interacting(); } } else { HoldingObjectManager.Instance().EmptyHands(); } } if (Input.GetKeyDown(KeyCode.H)) { SeedBagManager.AddSeeds(startingSeed); } if (Input.GetKeyDown(KeyCode.G)) { SeedBagManager.AddSeeds(startingSeed2); } }
public void SelectingSeed(int selection) { if (seedBag[selection + seedBase] != null && HoldingObjectManager.Instance().GrabingSomething(HoldingObjectManager.ObjectInHands.Seed)) { selectedSeed = seedBag[selection + seedBase]; Cursor.SetCursor(selectedSeed.GetPlantGenes().GetRandomGene(0).GetSeedCursor(), Vector2.zero, CursorMode.Auto); selectedSeedPos = selection + seedBase; } }
private void Awake() { instance = this; }