Merge branch 'main' into TT
# Conflicts: # .gitignore # Blacksmith/Assets/Editor/StarkBuilderSetting.asset # Blacksmith/Assets/Editor/StarkBuilderSetting.asset.meta # Blacksmith/Assets/Script/GameSystem.cs # Blacksmith/Assets/Script/UI/ForgePanel.cs # Blacksmith/UserSettings/Layouts/default-2022.dwlt # Blacksmith/project.config.json
This commit is contained in:
commit
2bee2c42b6
5
.gitignore
vendored
5
.gitignore
vendored
@ -93,9 +93,12 @@ Blacksmith/Library/
|
||||
Blacksmith/Temp/
|
||||
Blacksmith/Logs/
|
||||
Blacksmith/.idea/
|
||||
<<<<<<< Updated upstream
|
||||
Blacksmith/obj/
|
||||
Blacksmith/Bundles/WebGL/DefaultPackage/v1/defaultpackage_share_assets_pack_icon_ab672aa8e5ab40ed8ed986ca6f9f2e5e.bundle
|
||||
Blacksmith/Bundles/
|
||||
Blacksmith/Assets/StreamingAssets/yoo/
|
||||
Blacksmith/MemoryCaptures/
|
||||
Blacksmith/replay_pid21832.log
|
||||
=======
|
||||
Blacksmith/obj/
|
||||
>>>>>>> Stashed changes
|
||||
|
@ -2,7 +2,11 @@ fileFormatVersion: 2
|
||||
guid: 96132ae8c02642748804dc8b5f9f148e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
<<<<<<< Updated upstream
|
||||
mainObjectFileID: 11400000
|
||||
=======
|
||||
mainObjectFileID: 0
|
||||
>>>>>>> Stashed changes
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
48
Blacksmith/Assets/Pack/Prefab/AssetBundleManager.prefab
Normal file
48
Blacksmith/Assets/Pack/Prefab/AssetBundleManager.prefab
Normal file
@ -0,0 +1,48 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5224673688516134663
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4926553209939917423}
|
||||
- component: {fileID: 1974904697780077710}
|
||||
m_Layer: 0
|
||||
m_Name: AssetBundleManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4926553209939917423
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5224673688516134663}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -189.6, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1974904697780077710
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5224673688516134663}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0e6c3f75dfca4314999718542858d47d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
PlayMode: 2
|
||||
CDN: https://www.youtukeji.com.cn/Game/v1
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c1cea505894b6f4db2fa8f2654f8322
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
65190
Blacksmith/Assets/Pack/Prefab/Canvas.prefab
Normal file
65190
Blacksmith/Assets/Pack/Prefab/Canvas.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Blacksmith/Assets/Pack/Prefab/Canvas.prefab.meta
Normal file
7
Blacksmith/Assets/Pack/Prefab/Canvas.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e52b314be6e069439c3bb54fb42807e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
70
Blacksmith/Assets/Pack/Prefab/EventSystem.prefab
Normal file
70
Blacksmith/Assets/Pack/Prefab/EventSystem.prefab
Normal file
@ -0,0 +1,70 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5285230581760013045
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2574755898630511836}
|
||||
- component: {fileID: 3398476735080828447}
|
||||
- component: {fileID: 5933703811907282630}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2574755898630511836
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5285230581760013045}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3398476735080828447
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5285230581760013045}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!114 &5933703811907282630
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5285230581760013045}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SendPointerHoverToParent: 1
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
7
Blacksmith/Assets/Pack/Prefab/EventSystem.prefab.meta
Normal file
7
Blacksmith/Assets/Pack/Prefab/EventSystem.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a62c12f59d675f04781dc6ff7c821903
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
78
Blacksmith/Assets/Pack/Prefab/GameSystem.prefab
Normal file
78
Blacksmith/Assets/Pack/Prefab/GameSystem.prefab
Normal file
@ -0,0 +1,78 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &9131245087046894251
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3610832884203715935}
|
||||
- component: {fileID: 3880219494830862424}
|
||||
m_Layer: 0
|
||||
m_Name: GameSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3610832884203715935
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9131245087046894251}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3880219494830862424
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9131245087046894251}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 340223aa62c68cd43b3332527cdcc9fb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
drawingManager: {fileID: 0}
|
||||
abManager: {fileID: 0}
|
||||
List:
|
||||
- id: 0
|
||||
num: 2
|
||||
- id: 0
|
||||
num: 100
|
||||
- id: 0
|
||||
num: 2
|
||||
- id: 0
|
||||
num: 2
|
||||
saveStart:
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
- buyID: 1013
|
||||
npcID: 0
|
||||
DataAsset: {fileID: 11400000, guid: 98c00edc49c14bc4eb5bd9a15311b7f8, type: 2}
|
||||
maxTime: 100
|
||||
nowTime: 0
|
||||
goldCoin: 0
|
||||
playingGold: 0
|
||||
forgePanel: {fileID: 0}
|
||||
_npcBuyDatas: []
|
||||
seleTransform: {fileID: 0}
|
7
Blacksmith/Assets/Pack/Prefab/GameSystem.prefab.meta
Normal file
7
Blacksmith/Assets/Pack/Prefab/GameSystem.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bacfc73082021e74fb5a3350751b6793
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
46
Blacksmith/Assets/Pack/Prefab/PrefabPool.prefab
Normal file
46
Blacksmith/Assets/Pack/Prefab/PrefabPool.prefab
Normal file
@ -0,0 +1,46 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8513624141010957364
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1475571710723315422}
|
||||
- component: {fileID: 8026731211153694734}
|
||||
m_Layer: 0
|
||||
m_Name: PrefabPool
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1475571710723315422
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8513624141010957364}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -65.91, y: -8.307985, z: -0.12111312}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8026731211153694734
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8513624141010957364}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 117834e49a8abf346be608df5e7ba61b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
7
Blacksmith/Assets/Pack/Prefab/PrefabPool.prefab.meta
Normal file
7
Blacksmith/Assets/Pack/Prefab/PrefabPool.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0be07367f7edcfd4eb7b3ee812879d40
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -160,5 +160,35 @@
|
||||
"ConstantValue": "2602",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认解锁道具7"
|
||||
},
|
||||
{
|
||||
"ID": 28,
|
||||
"ConstantValue": "10",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认拥有木"
|
||||
},
|
||||
{
|
||||
"ID": 29,
|
||||
"ConstantValue": "10",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认拥有铁"
|
||||
},
|
||||
{
|
||||
"ID": 30,
|
||||
"ConstantValue": "10",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认拥有布"
|
||||
},
|
||||
{
|
||||
"ID": 31,
|
||||
"ConstantValue": "10",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认拥有皮"
|
||||
},
|
||||
{
|
||||
"ID": 32,
|
||||
"ConstantValue": "10",
|
||||
"ConstantString": "",
|
||||
"Commant": "默认拥有银"
|
||||
}
|
||||
]
|
File diff suppressed because it is too large
Load Diff
82
Blacksmith/Assets/Script/AdMgr.cs
Normal file
82
Blacksmith/Assets/Script/AdMgr.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using TTSDK;
|
||||
using TTSDK.UNBridgeLib.LitJson;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 广告管理器
|
||||
/// </summary>
|
||||
public class AdMgr : MonoBehaviour
|
||||
{
|
||||
private static AdMgr instance;
|
||||
|
||||
public static AdMgr Instance => instance;
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private TTRewardedVideoAd adInstance; //全局唯一的激励视频实例
|
||||
|
||||
private AdCallback callback; //广告播放完成回调
|
||||
private object args; //回调参数
|
||||
|
||||
private void Start()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
Init();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化激励视频广告
|
||||
/// </summary>
|
||||
private void Init()
|
||||
{
|
||||
string videoAdId = "8k6krp0rjl87k356al"; //激励视频广告id
|
||||
adInstance = TT.CreateRewardedVideoAd(
|
||||
videoAdId,
|
||||
(isClose, closeCode) => {
|
||||
Debug.Log("激励视频关闭 state: " + isClose + ", code: " + closeCode);
|
||||
|
||||
if (isClose)
|
||||
{
|
||||
//广告数据ROI
|
||||
TT.SendToTAQ(new JsonData
|
||||
{
|
||||
["event_type"] = "lt_roi"
|
||||
});
|
||||
if (callback != null)
|
||||
{
|
||||
callback(args);
|
||||
}
|
||||
}
|
||||
},
|
||||
(errorCode, errorMsg) => {
|
||||
Debug.Log("激励视频错误 " + errorCode);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示激励视频广告
|
||||
/// </summary>
|
||||
/// <param name="onShowFinish">广告显示完成回调</param>
|
||||
/// <param name="args">回调参数</param>
|
||||
public void ShowAd(AdCallback callback, object args = null)
|
||||
{
|
||||
this.callback = callback;
|
||||
this.args = args;
|
||||
|
||||
adInstance?.Show();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 广告显示完成回调
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public delegate void AdCallback(object args);
|
11
Blacksmith/Assets/Script/AdMgr.cs.meta
Normal file
11
Blacksmith/Assets/Script/AdMgr.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab33bcf0d5772b145a71e111b94ff711
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -74,8 +74,8 @@ public class GameSystem : MonoBehaviour
|
||||
|
||||
tab = new JsonTab();
|
||||
tab.InitData();
|
||||
abManager.InitAsset((() => { }));
|
||||
DotData.ins.SendEvent("a11101","");
|
||||
abManager.InitAsset((() => {}));
|
||||
|
||||
if (!DataManager.GetFirst())
|
||||
{
|
||||
AddDicData();
|
||||
@ -110,9 +110,8 @@ public class GameSystem : MonoBehaviour
|
||||
// DataManager.SaveItem(int.Parse(dataItemList[0]), int.Parse(dataItemList[1]));
|
||||
DataManager.SaveFirst();
|
||||
}
|
||||
|
||||
AssetBundleManager.ins.LoadAtlas();
|
||||
|
||||
|
||||
goldCoin = 5;
|
||||
drawingManager = transform.AddComponent<DrawingManager>();
|
||||
forgePanel.ResetItemData();
|
||||
@ -120,8 +119,10 @@ public class GameSystem : MonoBehaviour
|
||||
_npcBuyDatas = new List<NPCBuyData>();
|
||||
getNpc = false;
|
||||
SaveFirstID();
|
||||
UIMgr.ins.OpenForgePanel();
|
||||
forgePanel.ResetGold();
|
||||
});
|
||||
|
||||
// abManager.InitAsset(() =>
|
||||
// {
|
||||
// if (!DataManager.GetFirst())
|
||||
|
@ -69,26 +69,6 @@ public class PrefabPool : MonoBehaviour
|
||||
}
|
||||
});
|
||||
}
|
||||
public void LoadObj(string key,int i,Action<GameObject,int> action)
|
||||
{
|
||||
//如果池中没有该游戏物体或者游戏物体的队列中已经没有剩余的游戏对象时。
|
||||
//在这种情况下需要实例化一个新的物体,然后在判断是否需要在池中新加一个健值对还是直接放入队列中去
|
||||
//然后把新生成的放入池中。
|
||||
|
||||
if (!objDic.ContainsKey(key)||objDic[key].Count==0) {
|
||||
AssetBundleManager.ins.LoadAsset(key, (GameObject obj) =>
|
||||
{
|
||||
obj.name = key;
|
||||
obj.SetActive(true);
|
||||
action.Invoke(obj,i);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = objDic[key].Dequeue();
|
||||
obj.SetActive(true);
|
||||
action.Invoke(obj,i);
|
||||
}
|
||||
public void RecycleObj(GameObject obj)
|
||||
{
|
||||
//由于生成的预制体的name后面都会加上(Clone),所以我们需要将其去除
|
||||
|
@ -1,28 +0,0 @@
|
||||
diff a/Blacksmith/Assets/Script/PrefabPool.cs b/Blacksmith/Assets/Script/PrefabPool.cs (rejected hunks)
|
||||
@@ -34,6 +34,26 @@
|
||||
obj.SetActive(true);
|
||||
action.Invoke(obj);
|
||||
}
|
||||
+ public void LoadObj(string key,int i,Action<GameObject,int> action)
|
||||
+ {
|
||||
+ //如果池中没有该游戏物体或者游戏物体的队列中已经没有剩余的游戏对象时。
|
||||
+ //在这种情况下需要实例化一个新的物体,然后在判断是否需要在池中新加一个健值对还是直接放入队列中去
|
||||
+ //然后把新生成的放入池中。
|
||||
+
|
||||
+ if (!objDic.ContainsKey(key)||objDic[key].Count==0) {
|
||||
+ AssetBundleManager.ins.LoadAsset(key, (GameObject obj) =>
|
||||
+ {
|
||||
+ obj.name = key;
|
||||
+ obj.SetActive(true);
|
||||
+ action.Invoke(obj,i);
|
||||
+ });
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ var obj = objDic[key].Dequeue();
|
||||
+ obj.SetActive(true);
|
||||
+ action.Invoke(obj,i);
|
||||
+ }
|
||||
|
||||
public void AddPond(string key,int num)
|
||||
{
|
@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@ -20,6 +22,9 @@ public class ForgePanel : MonoBehaviour
|
||||
[SerializeField] private List<CraftingUI> _craftingUis;
|
||||
[SerializeField] private Button _craftButton;
|
||||
[SerializeField] private NPCTrigger _npcTrigger;
|
||||
[SerializeField] private SkeletonGraphic startAni;
|
||||
|
||||
[SerializeField] private GameObject openParent;
|
||||
[SerializeField] private Button startButton;
|
||||
[SerializeField] private Button title;
|
||||
[SerializeField] public Button _buyEventButton;
|
||||
@ -68,15 +73,23 @@ public class ForgePanel : MonoBehaviour
|
||||
public void Close()
|
||||
{
|
||||
_npcTrigger.Close();
|
||||
startButton.gameObject.SetActive(true);
|
||||
openParent.SetActive(true);
|
||||
_craftingPanel.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void OpenStartPanel()
|
||||
{
|
||||
_settlementPanel.gameObject.SetActive(true);
|
||||
openParent.SetActive(true);
|
||||
startAni.AnimationState.SetAnimation(0, "EnterAnim_1", false);
|
||||
startAni.AnimationState.Complete += StarIdle;
|
||||
_settlementPanel.SettlementEvent();
|
||||
}
|
||||
|
||||
public void StarIdle(TrackEntry trackentry)
|
||||
{
|
||||
startAni.AnimationState.Complete -= StarIdle;
|
||||
startAni.AnimationState.SetAnimation(0, "idle_1", true);
|
||||
}
|
||||
public void CloseTitle()
|
||||
{
|
||||
title.gameObject.SetActive(false);
|
||||
@ -110,10 +123,17 @@ public class ForgePanel : MonoBehaviour
|
||||
DotData.ins.SendEvent("a11105","");
|
||||
}
|
||||
DataManager.SetPrefab("openDoor",DataManager.GetPrefab("openDoor")+1);
|
||||
GameSystem.ins.StartNpcData();
|
||||
startButton.gameObject.SetActive(false);
|
||||
startAni.AnimationState.SetAnimation(0, "EnterAnim_2", false);
|
||||
startAni.AnimationState.Complete += StartEvent;
|
||||
}
|
||||
|
||||
private void StartEvent(TrackEntry trackentry)
|
||||
{
|
||||
startAni.AnimationState.Complete -= StartEvent;
|
||||
GameSystem.ins.StartNpcData();
|
||||
openParent.SetActive(false);
|
||||
}
|
||||
|
||||
void CraftEvent()
|
||||
{
|
||||
_craftingPanel.gameObject.SetActive(true);
|
||||
|
@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using WeChatWASM;
|
||||
|
||||
public class UIMgr : MonoBehaviour
|
||||
{
|
||||
@ -22,7 +21,6 @@ public class UIMgr : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
ins = this;
|
||||
OpenForgePanel();
|
||||
}
|
||||
|
||||
public void OpenForgePanel()
|
||||
@ -34,6 +32,7 @@ public class UIMgr : MonoBehaviour
|
||||
storePanel.gameObject.SetActive(false);
|
||||
combatPanel.gameObject.SetActive(false);
|
||||
endPanel.gameObject.SetActive(false);
|
||||
forgePanel.OpenStartPanel();
|
||||
}
|
||||
|
||||
public void OpenBattlePanel()
|
||||
|
@ -1,5 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f167b224892e7e34aad7ca52a0bcc83e
|
||||
guid: b2d995e5638e9b0448c24655d270243d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
@ -9,21 +9,21 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1795359250, guid: 1cf430f187a0b40eda7f668318d8be23, type: 3}
|
||||
m_Script: {fileID: 0}
|
||||
m_Name: MiniGameConfig
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: wx-editor:WeChatWASM:WXEditorScriptObject
|
||||
ProjectConf:
|
||||
projectName:
|
||||
Appid: wxebc4a7e0a0792246
|
||||
CDN: https://youtukeji.com.cn/Game/Blacksmithv2/
|
||||
Appid:
|
||||
CDN:
|
||||
assetLoadType: 0
|
||||
compressDataPackage: 1
|
||||
compressDataPackage: 0
|
||||
VideoUrl:
|
||||
DST: E:\Project\apk\Blacksmith
|
||||
DST: E:\UnityProject\Game\Blacksmith\
|
||||
StreamCDN:
|
||||
bundleHashLength: 32
|
||||
bundlePathIdentifier: StreamingAssets;
|
||||
bundleExcludeExtensions: json;version;bytes;
|
||||
bundleExcludeExtensions: json;
|
||||
AssetsUrl:
|
||||
MemorySize: 256
|
||||
HideAfterCallMain: 1
|
||||
@ -46,7 +46,7 @@ MonoBehaviour:
|
||||
UseMiniGameChat: 0
|
||||
PreloadWXFont: 0
|
||||
CompileOptions:
|
||||
DevelopBuild: 1
|
||||
DevelopBuild: 0
|
||||
AutoProfile: 0
|
||||
ScriptOnly: 0
|
||||
Il2CppOptimizeSize: 1
|
||||
@ -58,7 +58,7 @@ MonoBehaviour:
|
||||
CleanBuild: 0
|
||||
CustomNodePath:
|
||||
autoAdaptScreen: 1
|
||||
showMonitorSuggestModal: 0
|
||||
showMonitorSuggestModal: 1
|
||||
enableProfileStats: 0
|
||||
enableRenderAnalysis: 0
|
||||
enablePerfAnalysis: 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user