public void ReceiveByClientPortal_StartPlayCountDown(float second) { if(!readyStartPlay) { readyStartPlay = true; if(OnLoadSuccess != null) { OnLoadSuccess(); } } this.processState = PlayGameController.ProcessState.STARTPLAYCOUNTDOWN; this.startPlayCountDown = second; if(PlayerPrefs.GetString("GameType", "Single") == "Network") { if(second == 0) { AudioSource.PlayClipAtPoint(start2Audio, Camera.main.transform.position); } else { AudioSource.PlayClipAtPoint(start1Audio, Camera.main.transform.position); } } isGameInitialized = true; if(!isCountDownAnimaitonStarted) { if(countDownBat == null) { countDownBat = Camera.main.GetComponentInChildren<CountDownBat>(); } // countDownBat.SetStartFlyIn(); isCountDownAnimaitonStarted = true; } if(dynamicMaterial == null) { dynamicMaterial = Camera.main.GetComponentInChildren<DynamicMaterial>(); } // dynamicMaterial.SetCountdownRender((int)this.startPlayCountDown); // if(!isOpenMapCamera) // { // LittleMap mapCamera = FindObjectOfType(typeof(LittleMap)) as LittleMap; // mapCamera.SetCars(); // isOpenMapCamera = true; // } }
public void ReceiveByClientPortal_StartPlay() { // Debug.Log("ReceiveByClientPortal_StartPlay"); this.matchRoom.isMatchStart = true; readyStartPlay = false; if(countDownBat == null) { countDownBat = Camera.main.GetComponentInChildren<CountDownBat>(); } // countDownBat.SetStartFlyOut(); LittleMap mapCamera = FindObjectOfType(typeof(LittleMap)) as LittleMap; mapCamera.SetCars(); RankManager rankManager = FindObjectOfType(typeof(RankManager)) as RankManager; rankManager.SetRanksCar(); this.processState = PlayGameController.ProcessState.PLAY; if(OnGameStart != null) { OnGameStart(); } }