/// <summary> /// スコア初期化の /// サーバーにしか呼ばれていない /// </summary> public void Initialize(bool withoutLeftTime = false) { if (!withoutLeftTime) { leftTime = initialLeftTime; startTime = DateTime.Now.Hour * 60 * 60 + DateTime.Now.Minute * 60 + DateTime.Now.Second; } // score 計算は server だけ if (isServer) { score = initialScore; maxScore = initialScore; systemControllerInServer = SystemControllerInServer.Instance; print("Initialize score"); score = 0; for (int i = 0; i < systemControllerInServer.sculptureMap.Length; i++) { for (int j = 0; j < systemControllerInServer.sculptureMap[0].Length; j++) { for (int k = 0; k < systemControllerInServer.sculptureMap[0][0].Length; k++) { if (systemControllerInServer.sculptureMap[i][j][k] == systemControllerInServer.blockCollectionMap[i][j][k]) { score++; } maxScore++; } } } } }
/// <summary> /// Called by Unity when destroying a MonoBehaviour. Scripts that extend /// SingleInstance should be sure to call base.OnDestroy() to ensure the /// underlying static _Instance reference is properly cleaned up. /// </summary> protected virtual void OnDestroy() { _Instance = null; }