/// <summary> /// Awake /// </summary> void Awake() { a = GetComponent<Animator>(); r = GetComponent<Rigidbody>(); c = GetComponent<PlayerClimbing>(); pm = GetComponent<PlayerMotor>(); t = transform; }
/// <summary> /// Start /// </summary> private void Start() { //hud = GameObjectTools.GetComponentInChildren<menu_in_game_hud>(FindObjectOfType<menu_in_game>().gameObject); //hud = FindObjectOfType<menu_in_game>().gameObject.GetComponentInChildrenB<menu_in_game_hud>(); //hud = GetComponentsInChildren<menu_in_game_hud>(true)[0]; //menu_in_game m = FindObjectOfType<menu_in_game>(); //hud = m.GetComponentsInChildren<menu_in_game_hud>(true)[0]; pm = GetComponent<PlayerMotor>(); cam = GetComponent<PlayerCamera>(); cl = GetComponent<PlayerClimbing>(); atk = GetComponent<PlayerAttack>(); }
/// <summary> /// Initialize player movement. /// </summary> void Awake() { //Time.timeScale = 0.33f; t = transform; a = GetComponent<Animator>(); cl = GetComponent<PlayerClimbing>(); cam = GetComponent<PlayerCamera>(); atk = GetComponent<PlayerAttack>(); j = GetComponent<PlayerJumping>(); move_direction = transform.forward; }