// Update is called once per frame void Update () { if (!id.IsHunter() || !id.IsThisPlayer()) { return; } // May not be available on start, so we'll do it here instead if (!hidingManager) { if (PlayerManager.instance.otherPlayer) { hidingManager = PlayerManager.instance.otherPlayer.GetComponent<HidingManager>(); } } if (echoCooldownTimer >= echoCooldownTime && Input.GetButtonUp("Fire2")) { UseEcho(); echoCooldownTimer = 0; echoMovementCooldownTimer = 0; } if (echoCooldownTimer < echoCooldownTime) { echoCooldownTimer += Time.deltaTime; } // Don't let the player move for a short time after using this ability if (echoMovementCooldownTimer < echoMovementCooldownTime) { echoMovementCooldownTimer += Time.deltaTime; } UIManager.instance.UpdateProgress((echoCooldownTimer/echoCooldownTime) * 100); ui.SetProgress((echoCooldownTimer/echoCooldownTime) * 100); }
public override void HunterInteraction(Collider thisPlayer) { // If the Seeker is in this hiding place, remove them from hiding but don't immediately capture them // Call on the seeker object because it was easier thanks to networking issues.... HidingManager hidingManager = otherPlayer.gameObject.GetComponent <HidingManager>(); hidingManager.CheckHidingPlace(basketGameObject); }
public override void OnTriggerExit(Collider thisPlayer) { base.OnTriggerExit(thisPlayer); // Leave grass when the player walks outside HidingManager hidingManager = thisPlayer.gameObject.GetComponent <HidingManager>(); PlayerMovement3D movement = thisPlayer.gameObject.GetComponent <PlayerMovement3D>(); hidingManager.CmdStopHiding(); movement.inGrass = false; movement.onGrass = false; }
public override void SeekerInteraction(Collider thisPlayer) { HidingManager hidingManager = thisPlayer.gameObject.GetComponent <HidingManager>(); // Put the Seeker into hiding mode // Don't let them move and make them invisible if (!hidingManager.IsHiding()) { hidingManager.CmdHideInObject(basketGameObject); } else { hidingManager.CmdStopHiding(); } }
public override void SeekerInteraction(Collider thisPlayer) { HidingManager hidingManager = thisPlayer.gameObject.GetComponent <HidingManager>(); PlayerMovement3D movement = thisPlayer.gameObject.GetComponent <PlayerMovement3D>(); if (!hidingManager.IsHiding()) { hidingManager.CmdHideInArea(); movement.onGrass = false; movement.inGrass = true; } else { hidingManager.CmdStopHiding(); movement.onGrass = true; movement.inGrass = false; } }
void Start() { if (!isLocalPlayer) { return; } navAgent = GetComponent<NavMeshAgent>(); hidingManager = GetComponent<HidingManager>(); hunterEchoAbility = GetComponent<HunterEcho>(); id = GetComponent<PlayerIdentity>(); spriteManager = GetComponent<SpriteFollowPlayer>(); if (!Camera.main.GetComponent<followTarget3D>()) { return; } Camera.main.GetComponent<followTarget3D>().target = transform; GameObject.Find("Minimap Camera").GetComponent<followTarget3D>().target = transform; }
void Start() { if (!isLocalPlayer) { return; } navAgent = GetComponent <NavMeshAgent>(); hidingManager = GetComponent <HidingManager>(); hunterEchoAbility = GetComponent <HunterEcho>(); id = GetComponent <PlayerIdentity>(); spriteManager = GetComponent <SpriteFollowPlayer>(); if (!Camera.main.GetComponent <followTarget3D>()) { return; } Camera.main.GetComponent <followTarget3D>().target = transform; GameObject.Find("Minimap Camera").GetComponent <followTarget3D>().target = transform; }
bool validateStatus(Collider other) { if (ReferenceEquals(other, null)) { return(false); } PlayerIdentity otherId = other.gameObject.GetComponent <PlayerIdentity>(); HidingManager hidingManager = other.gameObject.GetComponent <HidingManager>(); if (ReferenceEquals(hidingManager, null)) { return(false); } // If the hunter clicks they can take the seeker out of hiding // All of this stuff needs to be synced to the server instead of just hopefully lining up // If the current player is the hunter and the collider they've run into is the Seeker and the Seeker isn't in hiding return(thisIsHunter && other.gameObject.tag == "Player" && otherId.IsSeeker() && !otherId.IsThisPlayer() && !hidingManager.IsHiding()); }
// Update is called once per frame void Update() { if (!id.IsHunter() || !id.IsThisPlayer()) { return; } // May not be available on start, so we'll do it here instead if (!hidingManager) { if (PlayerManager.instance.otherPlayer) { hidingManager = PlayerManager.instance.otherPlayer.GetComponent <HidingManager>(); } } if (echoCooldownTimer >= echoCooldownTime && Input.GetButtonUp("Fire2")) { UseEcho(); echoCooldownTimer = 0; echoMovementCooldownTimer = 0; } if (echoCooldownTimer < echoCooldownTime) { echoCooldownTimer += Time.deltaTime; } // Don't let the player move for a short time after using this ability if (echoMovementCooldownTimer < echoMovementCooldownTime) { echoMovementCooldownTimer += Time.deltaTime; } UIManager.instance.UpdateProgress((echoCooldownTimer / echoCooldownTime) * 100); ui.SetProgress((echoCooldownTimer / echoCooldownTime) * 100); }