Exemplo n.º 1
0
 // Use this for initialization
 void Awake()
 {
     _instance     = this;
     _animator     = GetComponent <Animator>();
     _movement     = GetComponent <Player_Movement>();
     _input        = GetComponent <Player_InputController>();
     _hp           = _OriginalHP;
     _transform    = GetComponent <Transform>();
     _cameraFollow = FindObjectOfType <Player_CameraFollow>();
     _hpBar        = FindObjectOfType <HPBarController>();
     _hammer       = GetComponent <Weapon_Hammer>();
 }
Exemplo n.º 2
0
        // Instantiates the colliders for all the attacks, also moves them to be childs of the character object
        private void Awake()
        {
            _basic1Collider = Instantiate(_basic1, transform.position, Quaternion.identity) as GameObject;
            _basic1Collider.transform.parent   = _hero.transform;
            _basic1Collider.transform.position = new Vector2(transform.position.x + 1, transform.position.y + 1);
            _basic1Collider.SetActive(false);

            _basic2Collider = Instantiate(_basic2, transform.position, Quaternion.identity) as GameObject;
            _basic2Collider.transform.parent   = _hero.transform;
            _basic2Collider.transform.position = new Vector2(transform.position.x + 1, transform.position.y + 1);
            _basic2Collider.SetActive(false);

            _specialCollider = Instantiate(_special, transform.position, Quaternion.identity) as GameObject;
            _specialCollider.transform.parent   = _hero.transform;
            _specialCollider.transform.position = new Vector2(transform.position.x + 1, transform.position.y + 1);
            _specialCollider.SetActive(false);

            _movement = GetComponent <Player_Movement>();
        }
 // Use this for initialization
 void Start()
 {
     _hammer         = FindObjectOfType <Weapon_Hammer>();
     _playerMovement = GetComponent <Player_Movement>();
 }