public void OnMouseDown() { if (inner == null) { return; } GraphicalSociety.refresh(inner); World.staticMap.world.ui.checkData(); }
public void scaling() { if (EventSystem.current.IsPointerOverGameObject()) { if (EventSystem.current.currentSelectedGameObject != null) { return; } } if (world.ui.state == UIMaster.uiState.WORLD) { if (Input.GetKeyDown("z") || Input.GetAxis("Mouse ScrollWheel") > 0) { GraphicalMap.lastMapChange += 1; GraphicalMap.scale = GraphicalMap.scale * 1.1f; if (GraphicalMap.scale > GraphicalMap.maxScale) { GraphicalMap.scale = GraphicalMap.maxScale; } GraphicalMap.checkData(); } else if (Input.GetKeyDown("x") || Input.GetAxis("Mouse ScrollWheel") < 0) { GraphicalMap.lastMapChange += 1; GraphicalMap.scale = GraphicalMap.scale / 1.1f; if (GraphicalMap.scale < GraphicalMap.minScale) { GraphicalMap.scale = GraphicalMap.minScale; } GraphicalMap.checkData(); } } if (world.ui.state == UIMaster.uiState.SOCIETY) { if (Input.GetKeyDown("z") || Input.GetAxis("Mouse ScrollWheel") > 0) { if (GraphicalSociety.focus != null) { GraphicalSociety.zoom += 0.1f; GraphicalSociety.refresh(GraphicalSociety.focus); } } else if (Input.GetKeyDown("x") || Input.GetAxis("Mouse ScrollWheel") < 0) { if (GraphicalSociety.focus != null && GraphicalSociety.zoom > 1) { GraphicalSociety.zoom -= 0.1f; GraphicalSociety.refresh(GraphicalSociety.focus); } } } }
public void clickOnSociety() { Vector3 pos = Input.mousePosition; double dist = 0; GraphicalSlot best = null; foreach (GraphicalSlot slot in GraphicalSociety.loadedSlots) { Vector3 slotLoc = world.outerCamera.WorldToScreenPoint(slot.transform.position); double d = (slotLoc - pos).sqrMagnitude; if (best == null || d < dist) { dist = d; best = slot; } } //GraphicalSociety.focus = best.inner; GraphicalSociety.refresh(best.inner); }
public void scaling() { //Anyone who wants to read can just pull this value and see if it has changed since they last polled if (Input.GetAxis("Mouse ScrollWheel") > 0) { scrollwheelTracking += 1; //World.log("mouse wheel pos"); } else if (Input.GetAxis("Mouse ScrollWheel") < 0) { scrollwheelTracking -= 1; //World.log("mouse wheel neg"); } if (EventSystem.current.IsPointerOverGameObject()) { if (EventSystem.current.currentSelectedGameObject != null) { return; } } if (world.ui.state == UIMaster.uiState.WORLD && world.ui.blocker == null) { if (UIKeybinds.getKey(UIKeybinds.Action.ZOOM_IN) || Input.GetAxis("Mouse ScrollWheel") > 0) { GraphicalMap.lastMapChange += 1; GraphicalMap.scale = GraphicalMap.scale * 1.1f; if (GraphicalMap.scale > GraphicalMap.maxScale) { GraphicalMap.scale = GraphicalMap.maxScale; } GraphicalMap.checkData(); } else if (UIKeybinds.getKey(UIKeybinds.Action.ZOOM_OUT) || Input.GetAxis("Mouse ScrollWheel") < 0) { GraphicalMap.lastMapChange += 1; GraphicalMap.scale = GraphicalMap.scale / 1.1f; if (GraphicalMap.scale < GraphicalMap.minScale) { GraphicalMap.scale = GraphicalMap.minScale; } GraphicalMap.checkData(); } } if (world.ui.state == UIMaster.uiState.SOCIETY && world.ui.blocker == null) { if (UIKeybinds.getKey(UIKeybinds.Action.ZOOM_IN) || Input.GetAxis("Mouse ScrollWheel") > 0) { if (GraphicalSociety.focus != null) { GraphicalSociety.zoom += 0.1f; GraphicalSociety.refresh(GraphicalSociety.focus); } } else if (UIKeybinds.getKey(UIKeybinds.Action.ZOOM_OUT) || Input.GetAxis("Mouse ScrollWheel") < 0) { if (GraphicalSociety.focus != null && GraphicalSociety.zoom > 1) { GraphicalSociety.zoom -= 0.1f; GraphicalSociety.refresh(GraphicalSociety.focus); } } } }
public void OnMouseDown() { GraphicalSociety.refresh(inner); World.staticMap.world.ui.checkData(); }