public override void OnInspectorGUI() { _mouseController = (MouseController)target; EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField("Current mode", _mouseController.CurrentMode.ToString()); _currentMode = (MouseController.MouseModes)EditorGUILayout.EnumPopup("Mouse mode", _currentMode); if (GUILayout.Button("Set mouse mode")) { _mouseController.ChangeMouseMode(_currentMode); } EditorGUILayout.EndVertical(); }
public void OnCombineClick() { if (maleSlot.iconInSlot != null && femaleSlot.iconInSlot != null) { geneticToAdd = breedingManager.Breed(maleSlot.iconInSlot.sample.unit, femaleSlot.iconInSlot.sample.unit); RemoveGeneticIcon(maleSlot.iconInSlot.sample.id); RemoveGeneticIcon(femaleSlot.iconInSlot.sample.id); maleSlot.RemoveIconFromSlot(); femaleSlot.RemoveIconFromSlot(); leftPanel.HideBreedingPopup(); mouseController.ChangeMouseMode(MouseMode.Targeting, targetingCallbackFunc: OnPlaceUnitDone); } }
public void SetBuildMode(BuildMode newMode, string type = null, bool useCratedObject = false, bool startBuildMode = true) { Building = true; BuildMode = newMode; BuildModeType = type; if (newMode == BuildMode.FLOOR) { buildModeTile = PrototypeManager.TileType.Get(type); } else if (newMode == BuildMode.FURNITURE) { this.useCratedObject = useCratedObject; CurrentPreviewRotation = 0f; } if (startBuildMode) { mouseController.ChangeMouseMode(MouseMode.BUILD); } }