IEnumerator Climb() { Vector2 upRight = new Vector2(1, 0.45f); Vector2 upLeft = new Vector2(-1, 0.45f); StartCoroutine(Zip()); Debug.Log("Set Colors"); ghook.SetPlayerColor(1, Color.green); ghook.SetPlayerColor(2, Color.yellow); while (climbing) { Debug.Log("Throw hook 1"); ghook.AimHook(1, upRight); ghook.ThrowHook(1); zip1 = true; yield return(new WaitForSeconds(0.5f)); ghook.RetractHook(2); zip2 = false; yield return(new WaitForSeconds(1f)); ghook.AimHook(2, upLeft); ghook.ThrowHook(2); zip2 = true; yield return(new WaitForSeconds(0.5f)); ghook.RetractHook(1); zip1 = false; yield return(new WaitForSeconds(1f)); } }
IEnumerator DoMarketing() { // Prepare Dangler GrapplingHook ghook = GameObject.Find("Dangle").GetComponent <GrapplingHook>(); ghook.DisableVisuals(); ghook.AimHook(1, Vector2.up); ghook.ThrowHook(1); ActivatePlayerGroup(GameObject.Find("StunPlayers")); ActivatePlayerGroup(GameObject.Find("StartingPlayers")); yield return(new WaitForSeconds(2.5f)); yield return(StartCoroutine(AdvanceCamera())); ActivatePlayerGroup(GameObject.Find("GoldPlayers")); yield return(new WaitForSeconds(3f)); yield return(StartCoroutine(AdvanceCamera())); ActivatePlayerGroup(GameObject.Find("SpikePlayers")); yield return(new WaitForSeconds(3.5f)); ActivatePlayerGroup(GameObject.Find("ClimbingPlayer")); Climber climber = GameObject.Find("ClimbingPlayer/Player2D").GetComponent <Climber>(); climber.StartClimb(); yield return(StartCoroutine(AdvanceCamera())); yield return(new WaitForSeconds(3f)); yield return(StartCoroutine(AdvanceCamera())); yield return(new WaitForSeconds(0.5f)); ghook = GameObject.Find("StunPlayers/Player2D").GetComponent <GrapplingHook>(); ghook.DisableVisuals(); ghook.AimHook(1, new Vector2(1f, 0.25f)); ghook.ThrowHook(1); yield return(new WaitForSeconds(2f)); yield return(StartCoroutine(AdvanceCamera())); }
void Update() { if ((player == null) || PauseMenu.gamePaused) { return; } if (player.device.LeftTrigger.IsPressed) { Debug.Log("left trigger is pressed"); } if (respawn.IsRespawning()) { gHook.AimHook(playerIndex + 1, Vector2.zero); gHook.Rappel(playerIndex + 1, Vector2.zero); mPick.AimPick(playerIndex + 1, Vector2.zero); return; } gHook.AimHook(playerIndex + 1, player.device.RightStick.Value); gHook.Rappel(playerIndex + 1, player.device.LeftStick.Value); mPick.AimPick(playerIndex + 1, player.device.LeftStick.Value); // allow aiming while stunned, but not tossing the pickaxe or shooting the hook if (stun.IsStunned()) { return; } if (player.device.RightTrigger.IsPressed) { gHook.ThrowHook(playerIndex + 1); } if (player.device.RightTrigger.WasReleased) { gHook.RetractHook(playerIndex + 1); } if (!player.device.LeftTrigger.IsPressed) { gHook.ActivateZip(playerIndex + 1); } }