Example #1
0
 /// <summary>
 /// Given a list of game objects, generate a GUI to choose from the list. Starts coroutine instantly after instantiation.
 /// </summary>
 public void StartChoose(GameObject selectorPrefab, GameObject[] gameObjects)
 {
     this.selectorPrefab = selectorPrefab;
     this.gameObjects    = gameObjects;
     //this.keycodeChoose = globalInputs.TestMessage();
     current       = 0;
     max           = gameObjects.Length - 1;
     currentObject = gameObjects[current];
     selector      = GenerateUISelector(selectorPrefab, gameObjects[current].transform.position); //generates UI at enemy location
     choosing      = true;
     _dPadGlobal   = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <DPadGlobal>();
 }
Example #2
0
 void Start()
 {
     state        = BattleState.INACTIVE;
     _hudsManager = GameObject.FindGameObjectWithTag("HudsManager");
     _tileManager = GameObject.FindGameObjectWithTag("TileManager");
     //_chooseObjectWithKeys = gameObject.GetComponent<ChooseObjectWithKeys>();
     _chooseObjectWithBools = gameObject.GetComponent <ChooseObjectWithBools>();
     _playerBattleGlobal    = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <PlayerBattleGlobal>();
     _dPadGlobal            = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <DPadGlobal>();
     _player             = GameObject.FindGameObjectWithTag("Player");
     _badgeFactory       = new BadgeFactory();
     attackButtonClicked = false;
 }
Example #3
0
    private void Start()
    {
        _textBoxGlobal = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <TextBoxGlobal>();
        _dPadGlobal    = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <DPadGlobal>();
        _hudsManager   = GameObject.FindGameObjectWithTag("HudsManager").GetComponent <HudsManager>();
        _playerObject  = GameObject.Find("Player");
        _textReader    = gameObject.GetComponent <TextReader>();

        //create icon
        _textIconObj = Instantiate(textTalkIconPrefab);
        _textIconObj.transform.parent   = gameObject.transform.parent.transform;
        _textIconObj.transform.position = gameObject.transform.parent.transform.position + pointOfSpeaking;
        _textIconObj.SetActive(false);

        if (_textReader.lines.Length > 0)
        {
            text = _textReader.lines[lineInText];
        }
    }
Example #4
0
    void Start()
    {
        _cap2D             = gameObject.GetComponent <CapsuleCollider2D>();
        _bm                = GameObject.FindGameObjectWithTag("BattleManager").GetComponent <BattleManager>();
        moved              = 1;
        _DPadGlobal        = GameObject.FindGameObjectWithTag("GlobalInputs").GetComponent <DPadGlobal>();
        isKeyboardMovement = false;
        _playerStats       = gameObject.GetComponent <PlayerStats>();
        _flag              = true;

        obstaclesTilemaps = GetObstaclesTileMaps();
        floorTilemaps     = GetFloorTileMaps();

        _jitterBuffer = 0.1f;
        _offset       = new Vector3(_cap2D.offset.x, _cap2D.offset.y, 0);

        canMoveDown  = true;
        canMoveLeft  = true;
        canMoveRight = true;
        canMoveUp    = true;
    }