private void FixedUpdate() { //foreach (string test in Input.GetJoystickNames()){ // Debug.Log(test); //} if (!lock_player_value) { fishMove(); aim(); harpoon(); gather(); obstruction(); if (inside_jellyman_base) { if (Input.GetButtonDown("ButtonY_2")) { //Debug.Log("button y pressed"); base_Manager.update_unit(); base_Manager.display_option(); } if (Input.GetButtonDown("ButtonB_2")) { //Debug.Log("button b pressed"); base_Manager.echange_wepaon(); base_Manager.display_option(); } } compteurTir -= Time.fixedDeltaTime; is_alive(); } }
private void FixedUpdate() { if (!lock_player_value) { shipMove(); aim(); harpoon(); obstruction(); hameconMove(); if (inside_human_base) { if (Input.GetButtonDown("ButtonY_1")) { Debug.Log("button y pressed"); base_Manager.update_unit(); base_Manager.display_option(); } if (Input.GetButtonDown("ButtonB_1")) { Debug.Log("button b pressed"); base_Manager.echange_wepaon(); base_Manager.display_option(); } } compteurTir -= Time.fixedDeltaTime; is_alive(); } }
private void OnTriggerEnter2D(Collider2D collision) { Debug.Log("enter into a trigger"); if (collision.gameObject.CompareTag("Human_base")) { Debug.Log("enter into a human base trigger"); base_ressource = collision.gameObject.GetComponent <Ressource_manager>(); base_Manager = collision.gameObject.GetComponent <Base_manager>(); int temp_divine_sponge = ship_ressource.get_divine_sponge(); ship_ressource.remove_divine_sponge(temp_divine_sponge); base_ressource.add_divine_sponge(temp_divine_sponge); base_Manager.display_option(); base_Manager.update_ui(); inside_human_base = true; } else if (collision.gameObject.CompareTag("Divine_sponge_ressource")) { // Debug.Log("hamecon contre éponge !"); ressource_recolte = collision.gameObject; inside_divine_sponge_ressource = true; } }
private void OnTriggerEnter2D(Collider2D collision) { //Debug.Log("enter into a trigger"); if (collision.gameObject.CompareTag("Jellyman_base")) { //Debug.Log("enter into a jelly base trigger"); base_ressource = collision.gameObject.GetComponent <Ressource_manager>(); base_Manager = collision.gameObject.GetComponent <Base_manager>(); int temp_divine_sponge = this.fish_ressource.get_divine_sponge(); fish_ressource.remove_divine_sponge(temp_divine_sponge); base_ressource.add_divine_sponge(temp_divine_sponge); base_Manager.display_option(); base_Manager.update_ui(); inside_jellyman_base = true; } else if (collision.gameObject.CompareTag("Divine_sponge_ressource")) { ressource_recolte = collision.gameObject; inside_divine_sponge_ressource = true; } }