private void OnDestroy() { m_referenceCount--; if (m_referenceCount == 0) { m_instance = null; } }
public void Win(bool winner) { transform.GetComponent <RoundManager>().gameStop = true; this.winner = winner; IsWin myWin = new IsWin(this.winner); LoginRequist.ucl.rpcCall("play.game_over", JsonConvert.SerializeObject(myWin), null); }
private void NotifyGameOver(Message msg) { //ServerModules.GameOverServer.text = "游戏结束"; object retParam = MessagePackDecoder <object>(msg.NotifyInfo.RpcParams); IsWin isWin = (IsWin)JsonConvert.DeserializeObject(retParam.ToString(), typeof(IsWin)); RoundManager.Instance.CheckBallList(); GameManager.Instance.ConfirmWin(isWin.Win); //DebugLogger.Debug(isWin.Win.ToString()); }
void Awake() { DontDestroyOnLoad(this); m_referenceCount++; if (m_referenceCount > 1) { Debug.LogError("Two Game Managers!"); DestroyImmediate(this.gameObject); return; } m_instance = this; }
public override int GetHashCode() { #if NETCOREAPP return(HashCode.Combine(IsWin, IsCtrl, IsAlt, IsShift, Key)); #else unchecked // Overflow is fine, just wrap { int hash = 17; hash = hash * 23 + IsWin.GetHashCode(); hash = hash * 23 + IsCtrl.GetHashCode(); hash = hash * 23 + IsAlt.GetHashCode(); hash = hash * 23 + IsShift.GetHashCode(); hash = hash * 23 + Key.GetHashCode(); return(hash); } #endif }
public override int GetHashCode() { int hash = 1; if (state_ != null) { hash ^= State.GetHashCode(); } if (IsWin != false) { hash ^= IsWin.GetHashCode(); } hash ^= moveRating_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void CheckWinningConditions(Transform ship) { float angle = ship.rotation.eulerAngles.z; if (angle > _model.LandingWinAngleMax || angle < _model.LandingWinAngleMin) { _model.ValidTimeOnPlatform += Time.deltaTime; } else { ResetPlatformTime(); } if ((_model.ValidTimeOnPlatform > _model.WinTimeOnPlatform) && _endGame == false) { IsWin?.Invoke(); _endGame = true; } }
void GameOverFunc() { IsWin myWin = new IsWin(true); LoginRequist.ucl.rpcCall("play.game_over", JsonConvert.SerializeObject(myWin), null); }