Exemple #1
0
 void DeactivateConsole()
 {
     UConsoleObj.Deactivate();
     uConsoleGO.SetActive(false);
     WorldController.Instance.gameState = GAME_STATE.PLAY;
     inputMode = INPUT_MODE.GAME;
 }
Exemple #2
0
        public JWTextBox()
        {
            _inputMode = INPUT_MODE.GENERAL;

            this.TextChanged += JWTextBox_TextChanged;
            this.Leave       += JWTextBox_Leave;
        }
Exemple #3
0
 void ActivateConsole()
 {
     uConsoleGO.SetActive(true);
     UConsoleObj.Activate();
     WorldController.Instance.gameState = GAME_STATE.PAUSE;
     inputMode = INPUT_MODE.CONSOLE;
 }
Exemple #4
0
 void DeactivateJobs()
 {
     WorldController.Instance.gameState = GAME_STATE.PLAY;
     WorldController.Instance.DestroyJobPanelItems();
     inputMode = INPUT_MODE.GAME;
     WorldController.Instance.jobsPanelPrefab.SetActive(false);
 }
Exemple #5
0
        void ActivateJobs()
        {
            WorldController.Instance.jobsPanelPrefab.SetActive(true);

            WorldController.Instance.gameState = GAME_STATE.PAUSE;
            WorldController.Instance.CreateJobPanelItems();
            inputMode = INPUT_MODE.SHOWING_JOBS;
        }
Exemple #6
0
 public void OperationMode_Change()
 {
     if (Inputmode == INPUT_MODE.GAMEPAD)
     {
         Inputmode = INPUT_MODE.KEYBORD;
     }
     else
     {
         Inputmode = INPUT_MODE.GAMEPAD;
     }
 }
Exemple #7
0
    public void ToggleInputMode()
    {
        input_mode = input_mode == INPUT_MODE.TIMER ? INPUT_MODE.MANUAL : INPUT_MODE.TIMER;
        switch (input_mode)
        {
        case INPUT_MODE.TIMER:
            interactionImage.sprite = timerImage;
            break;

        case INPUT_MODE.MANUAL:
            interactionImage.sprite = manualImage;
            break;
        }
    }
Exemple #8
0
    //------------------------------ INPUT MANAGER FUNCTIONS ------------------------------//

    private void SwitchInputMode(INPUT_MODE inputMode)
    {
        CurrentInputMode = inputMode;
        switch (CurrentInputMode)
        {
        case INPUT_MODE.NONE:
            if (selectingObject)
            {
                selectingObject.ChangeColor(selectingObject.defaultColor);
                selectingObject.UpdateInSceneObjectData();
                selectingObject.RemoveGizmo();
            }
            selectingObject = null;
            break;

        case INPUT_MODE.SELECTING:
            selectingObject.CreateGizmo(CurrentGizmoMode);
            break;
        }
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        lr = GetComponent<LineRenderer>();
        slicer = GetComponent<SpriteSlice>();

        lr.SetWidth(0.1f, 0.1f);

        lr.SetVertexCount(0);
        lineVerticies = new List<Vector3>();

        timeDelete = LINE_DELETE_ITERATOR;
        timeDraw = 0.0f;

        laserTimer = 0.0f;
        laserCanFire = true;

        disruptTimer = 0.0f;

        generalUseTimer = 0.0f;

        mode = INPUT_MODE.NORMAL;
    }
Exemple #10
0
    private void PlaceNewPopulationCentre()
    {
        if (popCentre == null)
        {
            Debug.Log("popCentre = null");
            return;
        }

        Vector3 popLocation = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        popLocation.z = -1.0f;

        GameObject newPopCentre = Instantiate(popCentre);

        newPopCentre.transform.position = popLocation;
        newPopCentre.GetComponent <Population>().populationIndex = populationCentreCount;
        newPopCentre.GetComponent <Population>().InitializeNewPopulation();
        popList.Add(newPopCentre);
        populationCentreCount++;

        Debug.Log("Pop centre Added");
        currentMode = INPUT_MODE.IDLE;
    }
Exemple #11
0
    public void Update()
    {
        if (Input.GetKeyDown(KeyCode.LeftControl) && currentMode != INPUT_MODE.PLACE_POP_CENTRE && currentMode != INPUT_MODE.PLACE_HUMAN_CENTRE)
        {
            currentMode = INPUT_MODE.PLACE_POP_CENTRE;
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            currentMode = INPUT_MODE.IDLE;
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (currentMode == INPUT_MODE.PLACE_POP_CENTRE)
            {
                PlaceNewPopulationCentre();
            }
            else if (currentMode == INPUT_MODE.PLACE_HUMAN_CENTRE)
            {
                PlaceHumanCentre();
            }
        }
        if (camControlsEnabled)
        {
            if (Input.GetKey(KeyCode.W))
            {
                //Move Camera Up
                gameObject.transform.position += Vector3.up * Time.deltaTime * GlobalGEPSettings.MOVE_SENSITIVITY;
                if (gameObject.transform.position.y > 50.0f)
                {
                    gameObject.transform.position = new Vector3(gameObject.transform.position.x, 50.0f, gameObject.transform.position.z);
                }
            }
            if (Input.GetKey(KeyCode.A))
            {
                //Move Camera Left
                gameObject.transform.position += Vector3.left * Time.deltaTime * GlobalGEPSettings.MOVE_SENSITIVITY;
                if (gameObject.transform.position.x < -50.0f)
                {
                    gameObject.transform.position = new Vector3(-50.0f, gameObject.transform.position.y, gameObject.transform.position.z);
                }
            }
            if (Input.GetKey(KeyCode.S))
            {
                //Move Camera Down
                gameObject.transform.position += Vector3.down * Time.deltaTime * GlobalGEPSettings.MOVE_SENSITIVITY;
                if (gameObject.transform.position.y < -50.0f)
                {
                    gameObject.transform.position = new Vector3(gameObject.transform.position.x, -50.0f, gameObject.transform.position.z);
                }
            }
            if (Input.GetKey(KeyCode.D))
            {
                //Move Camera Right
                gameObject.transform.position += Vector3.right * Time.deltaTime * GlobalGEPSettings.MOVE_SENSITIVITY;
                if (gameObject.transform.position.x > 50.0f)
                {
                    gameObject.transform.position = new Vector3(50.0f, gameObject.transform.position.y, gameObject.transform.position.z);
                }
            }

            //Add in Click-Drag?
        }
    }
Exemple #12
0
 public void SetInputMode(INPUT_MODE newMode_)
 {
     mode = newMode_;
     generalUseTimer = 0.0f;
 }
Exemple #13
0
 void HandleSpaceInput()
 {
     //If it hasn't been 4 seconds yet
     if (laserTimer < 4.0f)
     {
         if (Input.GetMouseButtonDown(0))
         {
             if (laserCanFire)
             {
                 GameObject g = GameObject.Instantiate(laserPrefab);
             }
         }
         else
         {
             //Reset the input gate. Player MUST lift finger to spawn new laser
             laserCanFire = true;
         }
         laserTimer += Time.deltaTime;
     }
     //Return to normal input once time is up
     else
     {
         mode = INPUT_MODE.NORMAL;
         laserTimer = 0;
     }
 }
Exemple #14
0
        private void readConfigurationFile()
        {
            string line;

            System.IO.StreamReader file = new System.IO.StreamReader("configuracion.txt");
            while ((line = file.ReadLine()) != null)
            {
                if (line != "" && line[0] != '#')
                {
                    String[] words = line.Split(' ');
                    switch (words[0]) {
                        case "movimiento":
                            if (Convert.ToInt32(words[1]) == 0)
                            {
                                currentInputMode = INPUT_MODE.PRESS;
                            }
                            else {
                                currentInputMode = INPUT_MODE.SLIDE;
                            }
                            break;
                        case "tamFranjas":
                            verticalSlideWidthPixel = Convert.ToInt32(words[1]);
                            break;
                        default: break;
                    }
                }
            }

            file.Close();
        }
Exemple #15
0
        // Update is called once per frame

        //state
        //bool showingJobs = false;
        //state

        public void SetInputMode(INPUT_MODE inputMode)
        {
            this.inputMode = inputMode;
        }