Merge remote-tracking branch 'origin/main' into main_ZYT
This commit is contained in:
@@ -125,6 +125,11 @@ public class GameLocal : MonoBehaviour
|
||||
public Place place = Place.Company1Floor;
|
||||
|
||||
public GameKey gameId;
|
||||
|
||||
// 总游玩时长
|
||||
public int vistAllTime = (int)(60 * 10f);
|
||||
|
||||
public float curGameTime = 0;
|
||||
|
||||
public GameObject Scene;
|
||||
public GameObject Settle;
|
||||
@@ -242,6 +247,11 @@ public class GameLocal : MonoBehaviour
|
||||
{
|
||||
return (long)DateTime.Now.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
}
|
||||
|
||||
public int GetNowTime()
|
||||
{
|
||||
return Mathf.RoundToInt(curGameTime);
|
||||
}
|
||||
|
||||
public string ConvertTimestampToDateTime(long timestamp)
|
||||
{
|
||||
|
||||
@@ -101,10 +101,7 @@ public class GameManager : NetworkBehaviour
|
||||
[NonSerialized]
|
||||
[SyncVar]
|
||||
public long vistEnd = 0;
|
||||
// 总游玩时长
|
||||
public int vistAllTime = (int)(60 * 10f);
|
||||
|
||||
public float curGameTime = 0;
|
||||
[SyncVar]
|
||||
public string settleData = "";
|
||||
|
||||
@@ -226,7 +223,7 @@ public class GameManager : NetworkBehaviour
|
||||
public void GameStart()
|
||||
{
|
||||
gameState = GameState.Playing;
|
||||
vistEnd = (long)(DateTime.Now.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + vistAllTime;
|
||||
vistEnd = (long)(DateTime.Now.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + GameLocal.Ins.vistAllTime;
|
||||
ChangeBgmRpc(1);
|
||||
// CreateTowers();
|
||||
AstarPath.active.Scan();
|
||||
@@ -736,13 +733,10 @@ public class GameManager : NetworkBehaviour
|
||||
{
|
||||
//服务器计算剩余时间并同步
|
||||
syncRemainingTime = GetLessTimeSeconds();
|
||||
curGameTime+=Time.deltaTime;
|
||||
GameLocal.Ins.curGameTime+=Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetNowTime()
|
||||
{
|
||||
return Mathf.RoundToInt(curGameTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -261,12 +261,12 @@ public class HttpServer : MonoBehaviour
|
||||
|
||||
private int GetGameTotalTime()
|
||||
{
|
||||
return Mathf.FloorToInt(GameManager.Ins.vistAllTime); // 举例:1 小时(秒)
|
||||
return Mathf.FloorToInt(GameLocal.Ins.vistAllTime); // 举例:1 小时(秒)
|
||||
}
|
||||
|
||||
private int GetCurrentPlayTime()
|
||||
{
|
||||
return GameManager.Ins.GetNowTime();
|
||||
return GameLocal.Ins.GetNowTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 0
|
||||
- enabled: 1
|
||||
path: Assets/_KOF/Scenes/Company1Floor.unity
|
||||
guid: 386a8fdea01af8a4e8d4a9835407ddec
|
||||
- enabled: 0
|
||||
@@ -203,7 +203,7 @@ EditorBuildSettings:
|
||||
- enabled: 0
|
||||
path: Assets/_KOF/Scenes/Shandong_Weifang_Linqu_WandaGuangchang.unity
|
||||
guid: 292b5f7fc61bdb0419b29f4c2c84a84a
|
||||
- enabled: 1
|
||||
- enabled: 0
|
||||
path: Assets/_KOF/Scenes/Jilin_Changchun_Chaoyang_OuyaMaichang.unity
|
||||
guid: 52d26ac3b92c1cc489f7036255cb62e2
|
||||
- enabled: 0
|
||||
|
||||
@@ -141,7 +141,9 @@ PlayerSettings:
|
||||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 1.0.1
|
||||
preloadedAssets: []
|
||||
preloadedAssets:
|
||||
- {fileID: 1814176829808956018, guid: 58f40b12bbc864f3c96c6505a9a1e1e3, type: 2}
|
||||
- {fileID: 11400000, guid: d0f8149c48842b4488cf6fb974cff9a2, type: 2}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
@@ -162,7 +164,7 @@ PlayerSettings:
|
||||
androidSupportedAspectRatio: 1
|
||||
androidMaxAspectRatio: 2.1
|
||||
applicationIdentifier:
|
||||
Android: com.pineappletech.kof.jilinchangchunchaoyangouyamaichang
|
||||
Android: com.pineappletech.kof.gongsi1lou
|
||||
Standalone: com.DefaultCompany.com.unity.template.ar
|
||||
buildNumber:
|
||||
Standalone: 0
|
||||
|
||||
Reference in New Issue
Block a user