You've already forked taptap2024_GJ_chidouren
updat core
This commit is contained in:
@@ -4,11 +4,13 @@ using System.Linq;
|
||||
using System.ScriptListener;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using FJson;
|
||||
using Framework.Asset;
|
||||
using Framework.Audio;
|
||||
using Framework.GamePool.manager;
|
||||
using Framework.Timer;
|
||||
using Framework.UI;
|
||||
using Framework.Utils.SingletonTemplate;
|
||||
using Game.Component;
|
||||
using Game.Data;
|
||||
using Game.EventDefine;
|
||||
using IcecreamView;
|
||||
@@ -16,6 +18,7 @@ using StateSystem;
|
||||
using UniFramework.Event;
|
||||
using UnityEngine;
|
||||
using Views;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
@@ -38,6 +41,8 @@ namespace Game
|
||||
|
||||
public GameState CurrentGameState => this._gameFsm.CurrentState;
|
||||
|
||||
public int PartIndex = 1;
|
||||
|
||||
public RoomGlobalData RoomGlobalData
|
||||
{
|
||||
get => _roomGlobalData;
|
||||
@@ -50,6 +55,10 @@ namespace Game
|
||||
this._gameFsm.Active (GameState.InitGame , args);
|
||||
GameUpdateMgr.Instance.AddUpdater (DoUpdate);
|
||||
this.BindEvent ();
|
||||
if (MapContent.Instance.ScenePart == null)
|
||||
{
|
||||
LoadScenePart (this.PartIndex);
|
||||
}
|
||||
this._gameFsm.OpenState (GameState.StartGame);
|
||||
}
|
||||
|
||||
@@ -102,6 +111,14 @@ namespace Game
|
||||
this.HasLock = false;
|
||||
}
|
||||
|
||||
public void LoadScenePart (int partIndex)
|
||||
{
|
||||
var loadName = $"AutoSource/Part/part{partIndex}.prefab";
|
||||
var scenePart = AssetManager.Instance.LoadAsset<GameObject> (loadName).GetComponent<ScenePart> ();
|
||||
var instantiate = Object.Instantiate (scenePart, MapContent.Instance.transform, true);
|
||||
MapContent.Instance.SetPart (instantiate);
|
||||
}
|
||||
|
||||
#region 事件
|
||||
|
||||
private void BindEvent ()
|
||||
@@ -122,7 +139,7 @@ namespace Game
|
||||
if (obj is GameEventDefine.OverlyCoin message)
|
||||
{
|
||||
AudioManager.Instance.PlaySoundEffect (SeAudio.Gaming_GetCoin);
|
||||
this.RoomGlobalData.OverlyCoin (message.overlyCoin , message.hasEcho);
|
||||
MapContent.Instance.OverlyCoin (message.overlyCoin);
|
||||
GlobalEventDefine.RefreshView.SendMessage ();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user