示例#1
0
 private void OnDestroy()
 {
     m_referenceCount--;
     if (m_referenceCount == 0)
     {
         m_instance = null;
     }
 }
示例#2
0
    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);
    }
示例#3
0
        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());
        }
示例#4
0
    void Awake()
    {
        DontDestroyOnLoad(this);

        m_referenceCount++;
        if (m_referenceCount > 1)
        {
            Debug.LogError("Two Game Managers!");
            DestroyImmediate(this.gameObject);
            return;
        }

        m_instance = this;
    }
示例#5
0
        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
        }
示例#6
0
    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);
    }
示例#7
0
        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;
            }
        }
示例#8
0
        void GameOverFunc()
        {
            IsWin myWin = new IsWin(true);

            LoginRequist.ucl.rpcCall("play.game_over", JsonConvert.SerializeObject(myWin), null);
        }