public static IEnumerator loser() { var fullURL = loserURL + id + "&u=" + player; Debug.Log(fullURL); WWW www = new WWW(fullURL); yield return(www); Debug.Log(www.text); WWW www2 = new WWW(checkLoserURL); yield return(www2); Loser loser = JsonUtility.FromJson <Loser>(www.text); if (loser.loser == player) { isLoser = true; } else { isLoser = false; } SceneManager.LoadScene("End"); }
public override int GetHashCode() { unchecked { var hashCode = (Winner != null ? Winner.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Loser != null ? Loser.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Time.GetHashCode(); return(hashCode); } }
public GameHistory ToGameHistory(bool fullEntry) { if (fullEntry == false) { return(new GameHistory(Id, Winner.ToPlayer(), Loser.ToPlayer(), WinnerFleet.ToFleetShallow(), LoserFleet.ToFleetShallow(), WasDraw, GameDate)); } else { return(new GameHistory(Id, Winner.ToPlayer(), Loser.ToPlayer(), WinnerFleet.ToFleetFull(), LoserFleet.ToFleetFull(), WasDraw, GameDate)); } }
public override void Serialize(GenericWriter writer) { base.Serialize(writer); var version = writer.SetVersion(0); switch (version) { case 0: { writer.WriteBlock(w => w.WriteType(Loser, t => Loser.Serialize(w))); writer.WriteBlock(w => w.WriteType(Winner, t => Winner.Serialize(w))); } break; } }
public void ShowGameOverPanel() { ICharacter winner = GetWinner(); GameOverPanel.SetActive(true); if (winner is PlayerController) { Winner.SetActive(true); Loser.SetActive(false); } else { Winner.SetActive(false); Loser.SetActive(true); } }
public void DeterminateWrestlersStatus() { if (WayOfWinning) // Victoire par K.O { if (Loser.lifePoint < 1) // VERIFICATION { Console.WriteLine($"{Loser.Name} est hors d'état et ne pourra plus combattre"); Loser.Status = Wrestler._status.Hors_d_etat; } if (Winner.lifePoint < Winner.GetMaxLife() / 2) { Winner.SetConvalescent(); } } else { Console.WriteLine($"{Winner.Name} est soigné et récupère toute sa vie"); Winner.SetMaxLife(); Loser.SetConvalescent(); } }
public override void Reset() { Loser.Reset(); Winner.Reset(); }
public override void Clear() { Loser.Clear(); Winner.Clear(); }
protected void OnLoser() { Loser?.Invoke(this, EventArgs.Empty); }
void Awake() { Instance = this; }
public override string ToString() { return("Winner: " + Winner.ToString() + " Loser: " + Loser.ToString()); //return this._loby.Name; }
private IEnumerator DisplayWinnerScreen() { yield return(null); MenuMan.gameEnd = true; string strWinnerName = string.Empty; GameObject Winner; GameObject Loser; Vector3 prevVelocity; Vector3 prevAngularVelocity; SoundMan.cutMusic(); SoundMan.playbwahbwahBWAH(); if (mintPlayer1Score > mintPlayer2Score) { // Player 1 won strWinnerName = mstrPlayer1CharName; Winner = Player1; Loser = Player2; } else { // Player 2 won strWinnerName = mstrPlayer2CharName; Winner = Player2; Loser = Player1; } //Save these for l8r prevVelocity = Loser.GetComponent <Rigidbody>().velocity; prevAngularVelocity = Loser.GetComponent <Rigidbody>().angularVelocity; Loser.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); Loser.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, 0); Camera.main.GetComponent <CombatCam>().lookAt(new Vector3(Loser.transform.position.x + Random.Range(-10, 10), Loser.transform.position.y + Random.Range(0, 10), Loser.transform.position.z + Random.Range(-10, 10))); Camera.main.GetComponent <CombatCam>().setTarget(Loser); yield return(new WaitForSeconds(0.3f)); Camera.main.GetComponent <CombatCam>().lookAt(new Vector3(Loser.transform.position.x + Random.Range(-10, 10), Loser.transform.position.y + Random.Range(0, 10), Loser.transform.position.z + Random.Range(-10, 10))); yield return(new WaitForSeconds(0.3f)); Camera.main.GetComponent <CombatCam>().lookAt(new Vector3(Loser.transform.position.x + Random.Range(-10, 10), Loser.transform.position.y + Random.Range(0, 10), Loser.transform.position.z + Random.Range(-10, 10))); //Explode into distance Loser.GetComponent <Rigidbody>().velocity = new Vector3(prevVelocity.x * 3, (prevVelocity.y + 1) * 50, prevVelocity.z * 3); Loser.GetComponent <Rigidbody>().angularVelocity = prevAngularVelocity * 2; yield return(new WaitForSeconds(2)); Camera.main.GetComponent <CombatCam>().setTarget(Winner); SoundMan.playResultsMusic(); Player1.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); Player2.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); Player1.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, 0); Player2.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, 0); Player1.transform.position = new Vector3(-2, 0.5f, 0); Player2.transform.position = new Vector3(2, 0.5f, 0); Camera.main.GetComponent <CombatCam>().resetCamera(); Camera.main.GetComponent <CombatCam>().lookAt(new Vector3(0, 3, 0)); SoundMan.playCharacterName(strWinnerName); yield return(new WaitForSeconds(1)); SoundMan.playWins(); yield return(new WaitForSeconds(3)); // TODO Enable winner screen Player1.GetComponent <PlayerControls>().CurrentAction = PlayerControls.ActionType.Dead; Player2.GetComponent <PlayerControls>().CurrentAction = PlayerControls.ActionType.Dead; // Yeet the loser Loser.transform.position = new Vector3(50, 50, 50); Camera.main.transform.position = new Vector3(100, 100, 90); Camera.main.transform.LookAt(new Vector3(100, 100, 100)); Winner.transform.position = new Vector3(100, 100, 100); Winner.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); Winner.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0); Winner.GetComponent <PlayerControls>().DisableGravity(); AnimationController.StartAnimation(strWinnerName, 1); EndGameOptionsController.gameObject.SetActive(true); EndGameOptionsController.EnableOptionsPanel(Player1Image.sprite, Player2Image.sprite); //QuitToTitle(); //ReturnToCharacterSelect(); //PlayAgain(); yield return(null); }