Beispiel #1
0
        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();
        }
Beispiel #2
0
    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);
        }
    }
Beispiel #3
0
    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);
        }
    }