38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Threading.Tasks;
|
|
using asap.core;
|
|
using Cinemachine;
|
|
using UnityEngine;
|
|
|
|
namespace Script.RuntimeScript
|
|
{
|
|
public class DiggingGameInit : MonoBehaviour
|
|
{
|
|
public GameObject BroadContainer;
|
|
public GameObject GridContianer;
|
|
public GameObject GridPropContianer;
|
|
public GameObject PropContainer;
|
|
public Texture2D CursorImg;
|
|
public CinemachineVirtualCamera CameraVir;
|
|
public GameObject ShowPropPositon;
|
|
public Transform FxRoot;
|
|
bool isStart = false;
|
|
public async Task OnStart()
|
|
{
|
|
isStart = true;
|
|
await GContext.container.Resolve<DiggingGameManager>().InitGame(this, CameraVir, BroadContainer, GridContianer, GridPropContianer, PropContainer, ShowPropPositon, FxRoot);
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
if (isStart)
|
|
{
|
|
GContext.container.Resolve<DiggingGameManager>().Update();
|
|
}
|
|
}
|
|
public void OnDestroy()
|
|
{
|
|
GContext.container.Resolve<DiggingGameManager>().Destroy();
|
|
}
|
|
}
|
|
}
|