void Awake() {
		if (instance == null)
			instance = this;
		else if (instance != this)
			Destroy (gameObject);

		DontDestroyOnLoad (gameObject);

		tileL = new List<HexTile> ();
		playerL = new List<Unit> ();
		enemyL = new List<Enemy> ();
		battleAnimation = new int[10];

		xpGrowthRate = this.gameObject.GetComponent<XpGrowthRate> ();
		playerInput = this.gameObject.GetComponent<PlayerKeyBoardInput> ();

		PauseUI.SetActive (false);
		TurnUI.SetActive (false);
		StatsUI.SetActive (false);
		StoryUI.SetActive (false);
		InvUI.GetComponent<InventoryManager> ().CreateDefault ();

		level = 0;
		inLevel = false;
		State = 0;
	}
Пример #2
0
	void Awake() {
		if (instance == null)
			instance = this;
		else if (instance != this)
			Destroy (gameObject);

		DontDestroyOnLoad (gameObject);

		tileL = new List<HexTile> ();
		playerL = new List<Unit> ();
		enemyL = new List<Enemy> ();

		playerInput = this.gameObject.GetComponent<PlayerKeyBoardInput> ();

		playersTurn = false;
		enemiesTurn = false;
	}
Пример #3
0
    public void ChangeCharacter()
    {
        if (_isUse == false)
        {
            _currentKeyBoardInput.enabled = false;

            _currentKeyBoardInput         = _player2.GetComponent <PlayerKeyBoardInput>();
            _currentKeyBoardInput.enabled = true;
            _camera.SetTarget(_player2.transform);

            _isUse = true;
        }
        else
        {
            _currentKeyBoardInput.enabled = false;

            _currentKeyBoardInput         = _player1.GetComponent <PlayerKeyBoardInput>();
            _currentKeyBoardInput.enabled = true;
            _camera.SetTarget(_player1.transform);

            _isUse = false;
        }
    }
Пример #4
0
 private void Start()
 {
     _currentKeyBoardInput = _player1.GetComponent <PlayerKeyBoardInput>();
 }