public void SendShotInfo(ShotInfo _shot) { Tutorial.instance.EraseTutorial(_shot); Thrower.instance.shotInfo = _shot; cntCuentaAtras.instance.Detener(); if (GameplayService.networked) { MsgThrow msg = Shark.instance.mensaje <MsgThrow>(); msg.LoadShot(Thrower.instance.shotInfo); ShotResult res = new ShotResult { Result = Result.Goal }; ScoreManager.Instance.CalculateScore(ref res); msg.points = res.ScorePoints + res.EffectBonusPoints; msg.send(); //Time.timeScale = 0.05f; } ClearEffects(); // Retrasa la cámara. if (ServiceLocator.Request <IGameplayService>().GetGameMode() == GameMode.GoalKeeper) { GoalCamera.instance.stateMachine.changeState = GoalKeeperCameraStates.Wait.instance; } else { //f4ke aqui para fakear los tiros de camara en single if (GameplayService.networked && !Goalkeeper.instance.m_networkDefenseReceived) { GoalCamera.instance.stateMachine.changeState = ThrowerCameraStates.WaitNetworkCamera.instance; } else { GoalCamera.instance.stateMachine.changeState = ThrowerCameraStates.Wait.instance; } } if (ServiceLocator.Request <IGameplayService>().GetGameMode() != GameMode.GoalKeeper) { // Mete tiempo de espera para el tiro. m_timeToThrow = GameplayService.networked ? float.MaxValue : deltaTimeToThrow; Material mat = gestureLine.GetComponent <Renderer>().material; Color col = mat.GetColor("_TintColor"); col.a = 0; mat.SetColor("_TintColor", col); } // Thrower.instance.DoThrow(); }
IEnumerator DelayShot() { while (BallPhysics.instance.state != BallPhysics.BallState.Waiting) { yield return(new WaitForSeconds(0.1f)); } if (infoNet.usedPower != -1) { PowerupService.instance.UsePowerup((Powerup)infoNet.usedPower); } yield return(new WaitForSeconds(3f)); Thrower.instance.shotInfo = MsgThrow.UnloadShot(infoNet); Thrower.instance.DoThrow(); GeneralSounds.instance.avisoDisparo(); yield return(true); }