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); } }
private void Awake() { instance = this; seedsAmount = new Text[seedsShown.Length]; for (int i = 0; i < seedsAmount.Length; i++) { seedsAmount[i] = seedsShown[i].transform.GetChild(0).GetComponent <Text>(); } UpdateSeeds(); }
public void EmptyHands() { switch (holding) { case ObjectInHands.Seed: SeedBagManager.ResetSelectedSeed(); break; case ObjectInHands.WaterCan: break; case ObjectInHands.Hoe: break; case ObjectInHands.Empty: break; default: break; } holding = ObjectInHands.Empty; }
void Update() { mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition); if (Input.GetKeyDown(KeyCode.A)) { SeedBagManager.AddSeeds(startingSeed); } if (Input.GetKeyDown(KeyCode.S)) { startingSeed = null; } if (Input.GetMouseButtonDown(0)) { if (Physics.Raycast(mouseRay, out selection, 200f, canSelect)) { IInteracting interacting = selection.transform.GetComponent <IInteracting>(); if (interacting != null) { interacting.Interacting(); } } } }