备份CatanBuilding瘦身独立工程
This commit is contained in:
51
Assets/Scripts/SupplyDrop/SupplyDropGameplayCtrl.cs
Normal file
51
Assets/Scripts/SupplyDrop/SupplyDropGameplayCtrl.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using game;
|
||||
using GameCore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
public class SupplyDropGameplayCtrl : ISupplyDropGameCtrl
|
||||
{
|
||||
protected ResetFishingStatusEvent resetFishing;
|
||||
protected Tables tables;
|
||||
public SupplyDropCtrl supplyDropCtrl { get; set; }
|
||||
public GameObject containerModel { get; set; }
|
||||
public GameObject gameModel { get; set; }
|
||||
public void AddPlayerItem(ItemData selectData)
|
||||
{
|
||||
GContext.container.Resolve<PlayerItemData>().AddItem(selectData);
|
||||
Debug.Log($"SupplyDropGameplayCtrl AddPlayerItem: {selectData.id}, count: {selectData.count}, curCount: {selectData.curCount}");
|
||||
supplyDropCtrl.targetAddData = new TargetAddData(selectData.id, (int)selectData.curCount, (int)selectData.count);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UIManager.Instance.UI3DCamera.gameObject.SetActive(false);
|
||||
|
||||
GContext.Publish(resetFishing);
|
||||
Debug.Log("SupplyDropGameplayCtrl disposed.");
|
||||
if (gameModel != null)
|
||||
{
|
||||
Addressables.ReleaseInstance(gameModel);
|
||||
}
|
||||
if (containerModel != null)
|
||||
{
|
||||
Addressables.ReleaseInstance(containerModel);
|
||||
}
|
||||
}
|
||||
|
||||
public void InitData(SupplyDropCtrl supplyDropCtrl, int supplyDropId, ResetFishingStatusEvent resetFishing)
|
||||
{
|
||||
this.supplyDropCtrl = supplyDropCtrl;
|
||||
tables = GContext.container.Resolve<Tables>();
|
||||
this.resetFishing = resetFishing;
|
||||
UIManager.Instance.UI3DCamera.gameObject.SetActive(true);
|
||||
|
||||
Init(supplyDropId);
|
||||
}
|
||||
protected virtual void Init(int id)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user