IEnumerator SetIDVAnimData(int playerID, int position) { NetworkedThirdPersonCharacter player = players.Find(x => x.playerID == playerID); player.GetComponent <Animator>().SetBool(position == 0 ? "Won" : "Lost", true); player.enabled = false; player.GetComponent <NetworkedThirdPersonUserControl>().enabled = false; player.GetComponent <PickUps>().enabled = false; player.GetComponent <Radar>().enabled = false; player.GetComponent <MakeRadarObject>().enabled = false; player.GetComponent <PlayerIKController>().enabled = false; player.GetComponent <CameraManager>().enabled = false; player.GetComponent <Rigidbody>().velocity = Vector3.zero; player.GetComponent <Rigidbody>().angularVelocity = Vector3.zero; player.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll; player.m_MouseLook.weapon.localPosition = new Vector3(-0.097f, 0.012f, 0.0928f); player.m_MouseLook.weapon.localRotation = Quaternion.Euler(new Vector3(358.417f, 258.623f, 261.856f)); player.weaponSpawnPoint.parent.gameObject.SetActive(false); Camera[] cams = player.GetComponentsInChildren <Camera>(); for (int i = 0; i < cams.Length; ++i) { cams[i].enabled = false; } player.GetComponentInChildren <Canvas>().gameObject.SetActive(false); player.transform.position = position < 3 ? controller.dataContainers[position].position.position : new Vector3(0, 250, 0); player.transform.rotation = Quaternion.identity; controller.dataContainers[position].score.text = scoreTable[player.playerID].ToString(); yield return(null); player.GetComponent <Animator>().SetBool(position == 0 ? "Won" : "Lost", false); }
private void Start() { PreStart(); multiplyer = 1; // get the third person character ( this should never be null due to require component ) m_Character = GetComponent <NetworkedThirdPersonCharacter>(); m_Character.m_MouseLook.player = player; m_Cam = transform.FindChild("Camera").transform; if (!isLocalPlayer) { m_Cam.gameObject.SetActive(false); //m_Character.enabled = false; } else { m_Character.joysticks = new List <Joystick>(player.controllers.Joysticks); if (player.controllers.Joysticks.Count > 0) { m_Character.m_MouseLook.XSensitivity *= 2; m_Character.m_MouseLook.YSensitivity *= 2; } } }
IEnumerator DoubleWeaponOutput(NetworkedThirdPersonCharacter player) { weaponOutputDoubled = true; player.damagePerSecond *= 2; yield return(new WaitForSeconds(powerupDuration)); player.damagePerSecond /= 2; weaponOutputDoubled = false; }
public override bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayer, GameObject gamePlayer) { LobbyPlayer player = lobbyPlayer.GetComponent <LobbyPlayer>(); NetworkedThirdPersonCharacter pl = gamePlayer.GetComponent <NetworkedThirdPersonCharacter>(); pl.name = player.playerName; pl.playerName = player.playerName; pl.playerColour = player.playerColor; pl.playerID = lobbySlots.ToList().FindIndex(x => x.GetComponent <LobbyPlayer>() == player); // conn.connectionId;// playerControllerId; return(true); }
private void RpcSetIdvGOControllerData(int playerID, int position) { if (position < 3) { StartCoroutine(SetIDVAnimData(playerID, position)); } else { NetworkedThirdPersonCharacter player = players.Find(x => x.playerID == playerID); player.gameObject.SetActive(false); } }