private void GO() { DS.PlayDietyWelcome(); readyObject.SetActive(false); goObject.SetActive(true); // free players if (HBS == null) { // Debug.Log("HBS = null"); hoverBoardScript[] hbsArray = FindObjectsOfType(typeof(hoverBoardScript)) as hoverBoardScript[]; for (int i = 0; i < hbsArray.Length; i++) { if (hbsArray[i].enabled) { // Debug.Log("found one hbs"); HBS = hbsArray[i]; if (HBS != null) { //Debug.Log("hbs has con is true"); HBS.roundStarted = true; } } } } else { // hbs enable ability to move //Debug.Log("allow board move"); HBS.roundStarted = true; } Invoke("EraseRoundCall", 1); }
private void RPC_GetPlayerComponents() { BH = ChildPlayer.GetComponent <BallHandling>(); BS = ChildPlayer.GetComponent <BallSteal>(); HBS = ChildPlayer.GetComponent <hoverBoardScript>(); PC = ChildPlayer.GetComponent <PlayerColor>(); ChildPlayer.transform.SetParent(this.transform); cRotScript = ChildPlayer.GetComponentInChildren <CameraRotation>(); cmm = ChildPlayer.GetComponentInChildren <CameraModeMedium>(); }
private void SetPlayer(GameObject spawningObject) { Debug.Log("setting up player"); PlayerColor PC = spawningObject.GetComponent <PlayerColor>(); PC.LocalPlayer = LocalPlayer; PC.SetUpPlayer1(this); HBS = spawningObject.GetComponent <hoverBoardScript>(); BH = spawningObject.GetComponent <BallHandling>(); BS = spawningObject.GetComponent <BallSteal>(); Debug.Log("finished setting up player"); }
// Use this for initialization void Start() { HV = FindObjectOfType <hoverBoardScript>(); Src = GetComponent <AudioSource>(); PS = FindObjectOfType <PlayerSoundSettings>(); if (PS) { HovVol = PS.SoundFXVol; } else { HovVol = 0.1f; } }
private void Start() { hBS = transform.GetComponent <hoverBoardScript>(); hBS.BoostPaddBoostLinearPercent = 0; }
public void RPC_ResetRound() { // Debug.Log("Reseting round"); roundNumber++; if (roundNumber >= maxRoundNumber) { // Debug.Log("End"); PV.RPC("RPC_End", RpcTarget.All); } else { if (HBS == null) { //Debug.Log("HBS = null"); hoverBoardScript[] hbsArray = FindObjectsOfType(typeof(hoverBoardScript)) as hoverBoardScript[]; for (int i = 0; i < hbsArray.Length; i++) { if (hbsArray[i].enabled) { Debug.Log("found one hbs"); HBS = hbsArray[i]; if (HBS != null) { Debug.Log("hbs has con is false"); HBS.roundStarted = false; //HBS.GetComponent<Rigidbody>().velocity = Vector3.zero; //HBS.Speed = 0; //HBS.m_currThrust = 0; //HBS.m_currTurn = 0; } } } } else { // gbs disable ability to move Debug.Log("disallow board move"); HBS.roundStarted = false; HBS.GetComponent <Rigidbody>().velocity = Vector3.zero; HBS.Speed = 0; HBS.m_currThrust = 0; } //roundCallText.text = "Round " + (roundNumber + 1); // round 2 if (roundNumber == 1) { for (int i = objectGroup_Round1.Length - 1; i >= 0; i--) { objectGroup_Round1[i].SetActive(false); } for (int i = objectGroup_Round2.Length - 1; i >= 0; i--) { objectGroup_Round2[i].SetActive(true); } for (int i = objectGroup_Round3.Length - 1; i >= 0; i--) { objectGroup_Round3[i].SetActive(false); } } // round 3 if (roundNumber == 2) { for (int i = objectGroup_Round1.Length - 1; i >= 0; i--) { objectGroup_Round1[i].SetActive(false); } for (int i = objectGroup_Round2.Length - 1; i >= 0; i--) { objectGroup_Round2[i].SetActive(false); } for (int i = objectGroup_Round3.Length - 1; i >= 0; i--) { objectGroup_Round3[i].SetActive(true); } } // Debug.Log("Destroy ball"); PhotonNetwork.Destroy(ball.gameObject); ball = null; bHandler.SpawnBall(); ball = FindObjectOfType <Ball>().gameObject; nSPawner.CallMoveNetDown(); textTime.text = ""; // Debug.Log("ResetPos"); if (PhotonNetwork.IsMasterClient) { PV.RPC("ResetPlayerPositions", RpcTarget.All); } } }