void HandleCanoe(string type) { if (type == "pickUpCanoe") { currentInventoryIndex = 0; anim.SetInteger("inventoryIndex", currentInventoryIndex); DisablePlayerInput(); MoveTowardsTarget(pickUpTarget, false); if (CheckIfAtTarget(pickUpTarget, false)) { playerCollider.enabled = true; targetFound = false; carryingCanoe = true; playerSoundManager.PlayPickUpCanoe(); anim.SetTrigger("PickUp"); canoe.SetActive(false); StartCoroutine(EnablePlayerInput(0.8f)); } } else if (type == "putdown") { currentInventoryIndex = 0; anim.SetInteger("inventoryIndex", 0); DisablePlayerInput(); MoveTowardsTarget(spawnTarget, true); if (CheckIfAtTarget(spawnTarget, true)) { playerCollider.enabled = true; targetFound = false; carryingCanoe = false; anim.SetTrigger("PutDown"); canoe.transform.position = new Vector3(transform.position.x, spawnTarget.position.y, 0); canoe.transform.GetChild(0).transform.GetChild(1).GetComponent <SpriteRenderer>().sortingOrder = sprite.sortingOrder - 1; //transform.position = canoe.transform.GetChild(0).transform.position; StartCoroutine(RevealCanoe(0.8f)); StartCoroutine(EnablePlayerInput(0.8f)); } } else if (type == "beginLaunch") { currentInventoryIndex = 0; anim.SetInteger("inventoryIndex", 0); DisablePlayerInput(); MoveTowardsTarget(putDownTarget, false); //currentInventoryIndex = 0; //anim.SetInteger("inventoryIndex", 0); if (CheckIfAtTarget(putDownTarget, false)) { playerCollider.enabled = true; targetFound = false; carryingCanoe = false; anim.SetTrigger("PutDown"); canoe.transform.position = spawnTarget.position; StartCoroutine(RevealCanoe(0.8f)); StartCoroutine(EnablePlayerInput(0.8f)); canLaunch = true; //Debug.Log("Launched"); } } else if (type == "launch") { if (pushCounter >= 1) { if (!whistled) { playerSoundManager.PlayWhistle(); whistled = true; } } if (pushCounter >= 2 && montyStateVariables.montyInCanoe) { targetFound = false; pushCounter = 0; whistled = false; transitionHandler.PreLaunch(); } else { currentInventoryIndex = 0; anim.SetInteger("inventoryIndex", 0); DisablePlayerInput(); montyStateManager.inTutorial = true; MoveTowardsTarget(pickUpTarget, false); if (CheckIfAtTarget(pickUpTarget, false)) { playerCollider.enabled = true; //playerSoundManager.PlayPushCanoe(); pushCounter++; canoe.transform.GetChild(0).GetComponent <Animator>().SetInteger("pushCounter", pushCounter); anim.SetTrigger("pushCanoe"); StartCoroutine(RevealCanoe(0.8f)); StartCoroutine(EnablePlayerInput(0.8f)); canLaunch = true; targetFound = false; carryingCanoe = false; } } } }