This commit is contained in:
2026-05-01 21:59:16 +08:00
parent dff505d073
commit e288c707ca
31 changed files with 6271 additions and 3370 deletions
+53 -32
View File
@@ -81,60 +81,78 @@ public class BeijingTimeManager : MonoSingleton<BeijingTimeManager>
private IEnumerator FetchBeijingTime()
{
// 使用返回北京时间的API
string[] timeServers = new string[]
{
"https://quan.suning.com/getSysTime.do", // 直接返回北京时间
"http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp", // 返回时间戳
"https://timeapi.io/api/Time/current/zone?timeZone=Asia/Shanghai",
"http://worldtimeapi.org/api/timezone/Asia/Shanghai",
"https://quan.suning.com/getSysTime.do"
};
foreach (string url in timeServers)
{
using (UnityWebRequest request = UnityWebRequest.Get(url))
using (UnityWebRequest request = UnityWebRequest.Get(url + "?_=" + DateTime.Now.Ticks))
{
request.timeout = 5;
request.url = url + "?_=" + DateTime.Now.Ticks; // 避免缓存
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.Success)
{
string jsonText = request.downloadHandler.text;
Debug.Log($"返回原始数据:{jsonText}");
if (!jsonText.TrimStart().StartsWith("{"))
{
Debug.LogWarning("返回的不是 JSON,跳过该源");
continue;
}
try
{
if (url.Contains("suning"))
JObject json = JObject.Parse(jsonText);
if (url.Contains("timeapi.io"))
{
string timeStr = json["dateTime"]?.ToString();
Debug.Log(timeStr);
if (!string.IsNullOrEmpty(timeStr))
{
_currentBeijingTime = DateTime.Parse(timeStr);
_timeSinceLastSync = 0;
_isTimeSynced = true;
Debug.Log($"北京时间同步成功:{_currentBeijingTime:yyyy-MM-dd HH:mm:ss}");
OnTimeSynced?.Invoke(_currentBeijingTime);
yield break;
}
}
else if (url.Contains("worldtimeapi"))
{
string timeStr = json["datetime"]?.ToString();
Debug.Log(timeStr);
if (!string.IsNullOrEmpty(timeStr))
{
_currentBeijingTime = DateTimeOffset.Parse(timeStr)
.ToOffset(TimeSpan.FromHours(8))
.DateTime;
_timeSinceLastSync = 0;
_isTimeSynced = true;
Debug.Log($"北京时间同步成功:{_currentBeijingTime:yyyy-MM-dd HH:mm:ss}");
OnTimeSynced?.Invoke(_currentBeijingTime);
yield break;
}
}
else if (url.Contains("suning"))
{
// 苏宁直接返回北京时间字符串
string jsonText = request.downloadHandler.text;
JObject json = JObject.Parse(jsonText);
string timeStr = json["sysTime2"]?.ToString();
Debug.Log(timeStr);
if (!string.IsNullOrEmpty(timeStr))
{
_currentBeijingTime = DateTime.ParseExact(timeStr, "yyyy-MM-dd HH:mm:ss", null);
_timeSinceLastSync = 0;
_isTimeSynced = true;
Debug.Log($"北京时间同步成功:{_currentBeijingTime:yyyy-MM-dd HH:mm:ss}");
OnTimeSynced?.Invoke(_currentBeijingTime);
yield break;
}
}
else if (url.Contains("taobao"))
{
// 淘宝返回时间戳(毫秒)
string jsonText = request.downloadHandler.text;
JObject json = JObject.Parse(jsonText);
string timestampStr = json["data"]?["t"]?.ToString();
if (!string.IsNullOrEmpty(timestampStr))
{
long timestamp = long.Parse(timestampStr);
// 时间戳是UTC时间的毫秒数,需要加8小时得到北京时间
DateTime utcTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(timestamp);
_currentBeijingTime = utcTime.AddHours(8);
_timeSinceLastSync = 0;
_isTimeSynced = true;
Debug.Log($"北京时间同步成功:{_currentBeijingTime:yyyy-MM-dd HH:mm:ss}");
OnTimeSynced?.Invoke(_currentBeijingTime);
yield break;
@@ -155,6 +173,9 @@ public class BeijingTimeManager : MonoSingleton<BeijingTimeManager>
_isTimeSynced = false;
}
/// <summary>
/// 获取格式化的北京时间
/// </summary>
+1 -1
View File
@@ -368,7 +368,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: -10
m_Sprite: {fileID: 21300000, guid: ee3a57413dbbc474eb77909505eeb7b0, type: 3}
m_Sprite: {fileID: 21300000, guid: bb2125586ffea274080cd4e6c4e9d605, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
+45 -45
View File
@@ -591,7 +591,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 132536, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 22400762, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
@@ -599,11 +599,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.x
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
@@ -611,51 +611,51 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 720.3
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 885.7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_Pivot.x
@@ -739,135 +739,135 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 1216.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 248.09999
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 1051.1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_SizeDelta.x
value: 306.8
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 484.19998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_SizeDelta.x
value: 165.4
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_SizeDelta.y
value: 36
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 82.7
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 958269219681220773, guid: 67117722a812a2e46ab8cb8eafbf5f5e,
type: 3}
@@ -113,6 +113,10 @@ public class MonsterContral : MonoBehaviour
// ================================================================
public virtual void Awake()
{
LoadHitEffect();
}
public async void LoadHitEffect()
{
// 查找受击特效子物体并默认隐藏
var hitTra = FindDeepChild(transform, "HitEffect");
@@ -202,7 +206,7 @@ public class MonsterContral : MonoBehaviour
public IEnumerator yanchi(GameObject obj,float time)
{
yield return new WaitForSeconds(time);
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
// ================================================================
// 状态机
@@ -399,8 +403,8 @@ public class MonsterContral : MonoBehaviour
{
AudioManager.Instance.PlayerFX(res.dieAudio[0]);
}
CreateFishManager.Instance.DieFishList(guid);
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
//Destroy(gameObject);
}
@@ -138,7 +138,7 @@ public class MonsterControl_BossBase : MonsterContral
public override void DieFish(RoomKillNotice obj = null)
{
isDieFish = true;
CreateFishManager.Instance.DieFishList(guid);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
GameManager.Instance.cameraShake.ShakePresets.Explosion2D(3f, 4f, 1f);
if (obj != null)
{
@@ -128,7 +128,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
private RoomFishProbabilityConfig bossCreateData; // Boss 创建数据
private float bossTimer = 999f; // Boss 刷新倒计时(秒)
private RoomFishProbabilityConfig yzCreateData; // 鱼阵创建数据
private float yzTimer=999f; // 鱼阵刷新倒计时(秒)
private float yzTimer = 999f; // 鱼阵刷新倒计时(秒)
private RoomFishProbabilityConfig ptCreateData; // 普通鱼创建数据
private float ptTimer = 999f; // 普通鱼批量启用倒计时(秒)
private int yzCount; // 本轮同时激活阵型数量
@@ -138,7 +138,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
/// <summary>是否开启放鱼(false 时 Update 不执行生成逻辑)</summary>
public bool fangzhu;
public bool isResources=false;
public bool isResources = false;
// ================================================================
// 懒加载属性
// ================================================================
@@ -193,7 +193,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
EventCenter.Instance.AddEventListener<SyncGameData>(
ConstEventString.SyncGameData_CreateFish, CreateFish);
}
public void InitChuYu()
@@ -202,8 +202,8 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
yzCount = Random.Range(yzCreateData.countRange[0], yzCreateData.countRange[1]);
ptCount = Random.Range(ptCreateData.countRange[0], ptCreateData.countRange[1]);
bossCount = Random.Range(ptCreateData.countRange[0], ptCreateData.countRange[1]);
yzTimer = 0.5f ;
ptTimer =0.5f ;
yzTimer = 0.5f;
ptTimer = 0.5f;
bossTimer = 5f;
//yzTimer = Random.Range(yzCreateData.timeRange[0], yzCreateData.timeRange[1]);
//ptTimer = Random.Range(ptCreateData.timeRange[0], ptCreateData.timeRange[1]);
@@ -265,9 +265,10 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
{
bossTimer -= dt;
if (bossTimer > 0f) return;
bossCount = Random.Range(ptCreateData.countRange[0], ptCreateData.countRange[1]);
bossTimer = Random.Range(bossCreateData.timeRange[0], bossCreateData.timeRange[1]);
if (!fishTypeConfig.TryGetValue(FishTypeEnum.Boss鱼, out var bossList) || bossList.Count == 0)
return;
//foreach (var item in bossList)
@@ -277,7 +278,42 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
// item.isCreate = 2;
// }
//}
bossList[Random.Range(0, bossList.Count)].isCreate = 2;
StartCoroutine(buchongfu(bossList, bossCount));
}
IEnumerator buchongfu(List<RoomFishDetailConfig> bossList,int count)
{
for (int j = 0; j < count; j++)
{
while (true)
{
int i = Random.Range(0, bossList.Count);
if (fishDatas_hashCodekey_Boss.Count > 0)
{
foreach (var item in fishDatas_hashCodekey_Boss)
{
if (bossList[i].fishNumber != item.Value.fishTypeID.ToString())
{
bossList[i].isCreate = 2;
yield break;
}
}
}
else
{
bossList[i].isCreate = 2;
yield break;
}
yield return null;
}
}
}
/// <summary>每 1~3 秒随机激活若干组鱼阵。</summary>
@@ -286,11 +322,11 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
yzTimer -= dt;
if (yzTimer > 0f) return;
yzCount = Random.Range(yzCreateData.countRange[0], yzCreateData.countRange[1]);
yzTimer = Random.Range(yzCreateData.timeRange[0], yzCreateData.timeRange[1]);
int lineCount = yz_FishConfig_Line_List.Count;
if (lineCount == 0) return;
@@ -473,8 +509,12 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
{
foreach (var item in config.normalFishList)
{
spawnDic[item.fishNumber] = item;
spawnList.Add(item);
if (!spawnDic.ContainsKey(item.fishNumber))
{
spawnDic[item.fishNumber] = item;
spawnList.Add(item);
}
if (item.type == 1)
{
@@ -516,7 +556,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
break;
}
break;
case 2:
case 2:
//yzTimer=item.
yzCreateData = item;
break;
@@ -528,7 +568,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
foreach (var item in config.roomFishLevelList)
{
if (item.roomLevel != currRoomLevel) continue;
if (item.type == 2)
{
spawnDic[item.fishNumber] = item;
@@ -619,7 +659,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
if (fishRoot == null) return;
foreach (var item in fishDatas_hashCodekey)
{
if (item.Value.gameObject!=null)
if (item.Value.gameObject != null)
{
Destroy(item.Value.gameObject);
@@ -752,7 +792,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
mc.monsterData.fishTypeConfig = FishDatas[createFishData.fishNumber];
mc.guid = createFishData.guid;
mc.moveTime = (BeijingTimeManager.Instance.CurrentTimestampMs - time) / 1000f;
mc.fishenum=(FishTypeEnum) fishType.fishType;
mc.fishenum = (FishTypeEnum)fishType.fishType;
// 按鱼类型放入对应字典
RegisterFishInstance(mc, fishType.fishType);
@@ -766,9 +806,9 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
Debug.LogError(createFishData.fishNumber);
Debug.LogError(ex.Message);
}
return true;
}
@@ -838,12 +878,12 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
int chosen710 = (prefix == "710")
? pathList[Random.Range(0, pathList.Count)]
: -1;
foreach (int pathId in pathList)
{
int actualPath = (prefix == "710") ? chosen710 : pathId;
StartCoroutine(YZ7007(createFishData, yz, pos, prefab, actualPath, time, yz.fishCount));
}
StartCoroutine(YZ7007(createFishData, yz, pos, prefab, chosen710, time, yz.fishCount));
//foreach (int pathId in pathList)
//{
// int actualPath = (prefix == "710") ? chosen710 : pathId;
// StartCoroutine(YZ7007(createFishData, yz, pos, prefab, actualPath, time, yz.fishCount));
//}
break;
default:
@@ -888,7 +928,9 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
//var fish = Instantiate(prefab, pos, rotation, fishRoot);
var fish = Pool.Instance.Get(int.Parse(yz.fishNumber), pos, rotation, fishRoot);
var mc = fish.GetComponent<MonsterContral>();
RegisterFishInstance(mc, FishDatas[yz.fishNumber].fishType);
mc.monsterData.fishTypeConfig = FishDatas[yz.fishNumber];
mc.guid = createFishData.guid + i;
@@ -920,6 +962,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
var fish = Pool.Instance.Get(int.Parse(yz.fishNumber), pos, rotation, fishRoot);
var mc = fish.GetComponent<MonsterContral>();
RegisterFishInstance(mc, FishDatas[yz.fishNumber].fishType);
mc.monsterData.fishTypeConfig = FishDatas[yz.fishNumber];
mc.guid = createFishData.guid + i;
@@ -950,6 +993,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
var fish = Pool.Instance.Get(int.Parse(yz.fishNumber), pos, Quaternion.identity, fishRoot);
var mc = fish.GetComponent<MonsterContral>() ?? fish.AddComponent<MonsterContral>();
RegisterFishInstance(mc, FishDatas[yz.fishNumber].fishType);
mc.monsterData.fishTypeConfig = FishDatas[yz.fishNumber];
mc.guid = createFishData.guid + i;
@@ -1071,7 +1115,27 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
{
if (!fishDatas_hashCodekey.TryGetValue(fishId, out var monster)) return;
Pool.Instance.Return(monster.gameObject);
switch (monster.fishenum)
{
case FishTypeEnum.普通鱼:
fishDatas_hashCodekey_Small.Remove(fishId);
break;
case FishTypeEnum.Boss鱼:
fishDatas_hashCodekey_Boss.Remove(fishId);
break;
case FishTypeEnum.黄金鱼:
fishDatas_hashCodekey_Small.Remove(fishId);
break;
case FishTypeEnum.特殊鱼:
fishDatas_hashCodekey_Small.Remove(fishId);
break;
default:
break;
}
fishDatas_hashCodekey.Remove(fishId);
}
@@ -1126,25 +1190,6 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
for (int i = 0; i < ids.Count; i++)
Id_DieFish_FX(ids[i], coinNum[i], v3Point);
}
public void DieFishList(string guid)
{
fishDatas_hashCodekey.Remove(guid);
if (fishDatas_hashCodekey_Boss.ContainsKey(guid))
{
fishDatas_hashCodekey_Boss.Remove(guid);
}
if (fishDatas_hashCodekey_Small.ContainsKey(guid))
{
fishDatas_hashCodekey_Small.Remove(guid);
}
}
/// <summary>
/// 收到服务器 WebSocket 杀鱼通知,处理金币加分、特效、音效。
/// </summary>
@@ -1156,13 +1201,13 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
Debug.Log($"[CreateFishManager] 杀鱼延迟:{DateTimeOffset.Now.ToUnixTimeSeconds() - killFish.timespan}s");
foreach (var item in currGameType.list_Sits)
{
if (item.user==killFish.userId)
if (item.user == killFish.userId)
{
item.monCotl_Lock=null;
item.monCotl_Lock = null;
//item.lockFX.gameObject.SetActive(false);
}
}
if (!fishDatas_hashCodekey.TryGetValue(killFish.fishId, out var monster)) return;
// 加分回调(在金币飞完后执行)
@@ -1200,12 +1245,12 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
var coinScript = award.GetComponent<CoinScript>();
foreach (var item in currGameType.list_Sits)
{
if (killFish.userId==item.user)
if (killFish.userId == item.user)
{
coinScript.endPoint = item.transform;
}
}
coinScript.isBoss = false;
coinScript.SetCoinCount(killFish.gold);
coinScript.JiaFen = onScoreAdd;
@@ -1221,7 +1266,7 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
bossCtrl.v3 = item.transform.position;
}
}
bossCtrl.tMP_CurrBossScore = Instantiate(
monster.effect_DieAward != null ? monster.effect_DieAward : dieFXPrefabAwardTmp,
currGameType.subPanelParent.parent)
@@ -16,7 +16,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &5302568498764232125
Transform:
m_ObjectHideFlags: 0
@@ -82,6 +82,7 @@ MonoBehaviour:
ZhuCam: {fileID: 0}
isDieFish: 0
dieTime: 3
v3: {x: 0, y: 0, z: 0}
idleAnim: {fileID: 6129148253674940553}
dieAnim: {fileID: 6970894660364473911}
subCamera: {fileID: 4224776573722881310}
@@ -39,9 +39,11 @@ public class HHWK_BGJ_Boss : MonsterControl_BossBase
}
public override void OnMoveUpdata()
{
moveTime += Time.deltaTime;
if (moveTime >= monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
@@ -71,7 +71,8 @@ public class HHWK_BCJX_Boss : MonsterControl_BossBase
base.OnMoveUpdata();
if (moveTime >= monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
}
@@ -109,7 +109,7 @@ public class HHWK_CE_Boss : MonsterControl_BossBase
{
if (isEnd)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
isEnd =true;
@@ -28,7 +28,7 @@ public class HHWK_ShaSeng_Boss : MonsterControl_BossBase
obj_Skill103Effect.SetActive(false);
obj_Skill2Effect.SetActive(false);
obj_Skill3Effect.SetActive(false);
idleAnim.transform.parent.gameObject.SetActive(false);
idleAnim.transform.parent.gameObject.SetActive(true);
skillAnim.transform.parent.gameObject.SetActive(false);
idleAnim.Play("swim");
}
@@ -37,7 +37,8 @@ public class HHWK_ShaSeng_Boss : MonsterControl_BossBase
base.OnMoveUpdata();
if (moveTime>=monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
public override void DieFish(RoomKillNotice obj = null)
@@ -81,7 +81,8 @@ public class EffWuKong_Skill : MonoBehaviour
AudioManager.Instance.PlayerFX(fishResourcesData.dieGlodAduio["End"]);
}
Pool.Instance.Return(hHWK_SWK_Boss.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hHWK_SWK_Boss.guid);
//Destroy(hHWK_SWK_Boss.gameObject);
}
@@ -51,7 +51,7 @@ public class HHWK_SWK_Boss : MonsterControl_BossBase
base.OnMoveUpdata();
if (moveTime >= monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
@@ -78,7 +78,7 @@ public class HHWK_TS_Boss : MonsterControl_BossBase
base.OnMoveUpdata();
if (moveTime >= monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
@@ -60,7 +60,7 @@ public class HHWK_TSGZ_Boss : MonsterControl_BossBase
base.OnMoveUpdata();
if (moveTime >= monsterData.moveLine.moveTime)
{
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
}
@@ -16,7 +16,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1418836501065536891
Transform:
m_ObjectHideFlags: 0
@@ -83,6 +83,7 @@ MonoBehaviour:
ZhuCam: {fileID: 0}
isDieFish: 0
dieTime: 3
v3: {x: 0, y: 0, z: 0}
YuXiIdle: {fileID: 7257884918830399258}
Skill1: {fileID: 7646974360807019699}
Skill2: {fileID: 5278187979067370685}
@@ -50,7 +50,7 @@ public class HHWK_ZBJ_Boss : MonsterControl_BossBase
if (moveTime >= monsterData.moveLine.moveTime)
{
Destroy(gameObject);
Pool.Instance.Return(gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(guid);
}
}
File diff suppressed because it is too large Load Diff
@@ -489,9 +489,9 @@ RectTransform:
- {fileID: 46913393239263610}
m_Father: {fileID: 8080891624328096898}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 375}
m_SizeDelta: {x: 1624, y: 750}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1407431973574947431
+6 -2
View File
@@ -24,10 +24,14 @@ public class LoginPanel : UIBase
//这里要跳转到具体的登录界面
UIManager.Instance.ShowAsync(UIPanel.HomeMainPanel, UIPanel.LoginPanel);
}
private void Awake()
{
Destroy(GameManager.Instance.btn_Skip.gameObject);
}
public override void Show(object args = null)
{
base.Show(args);
Destroy(GameManager.Instance.btn_Skip.gameObject);
base.OnShow(args);
if (loadingParent.activeSelf)
{
loadingParent.SetActive(false);
@@ -16,7 +16,7 @@ public class Eff_BCJX_Skill_AniEvent : MonoBehaviour
{
if (index >= hWK_BCJX_Boss.prizeCount)
{
Pool.Instance.Return(hWK_BCJX_Boss.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hWK_BCJX_Boss.guid);
//Destroy(hWK_BCJX_Boss.gameObject);
}
else
@@ -6,7 +6,7 @@ public class Eff_bgjDie_AniEvent : MonoBehaviour
public void skillEnd()
{
//Destroy(transform.parent.parent.gameObject);
Pool.Instance.Return(transform.parent.parent.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(GetComponentInParent<HHWK_BGJ_Boss>().guid);
}
public void startFly()
@@ -49,7 +49,8 @@ public class Eff_changE_SkillEvent : MonoBehaviour
else
{
//Destroy(transform.parent.parent.gameObject);
Pool.Instance.Return(transform.parent.parent.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(GetComponentInParent<HHWK_CE_Boss>().guid);
}
isEnd = true;
}
@@ -29,9 +29,10 @@ public class Eff_longDie_AniEvent : MonoBehaviour
transform.parent.gameObject.SetActive(false);
}
else
Pool.Instance.Return(transform.parent.parent.gameObject);
//Destroy(transform.parent.parent.gameObject);
isFirst = false;
CreateFishManager.Instance.Id_DieFish_NotFX(hHWK_BLM_Boss.guid);
//Destroy(transform.parent.parent.gameObject);
isFirst = false;
}
public void Jiao()
{
@@ -9,7 +9,7 @@ public class Eff_long_AniEvent : MonoBehaviour
{
//transform.parent.parent.gameObject.SetActive(false);
//Destroy( transform.parent.parent.gameObject);
Pool.Instance.Return(transform.parent.parent.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(GetComponentInParent<HHWK_BLM_Boss>().guid);
}
num++;
@@ -121,10 +121,11 @@ public class Eff_shaseng_Skill1_AniEvent : MonoBehaviour
HHWK_ShaSeng_Boss.obj_Skill2Effect.SetActive(false);
if (count == 4)
{
Pool.Instance.Return(HHWK_ShaSeng_Boss.gameObject);
//Destroy(HHWK_ShaSeng_Boss.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(HHWK_ShaSeng_Boss.guid);
//Destroy(HHWK_ShaSeng_Boss.gameObject);
}
else
else
{
skillAnimation.CrossFade(nextAnimationClip, 0.3f);
FishResourcesData fishResourcesData;
@@ -61,9 +61,10 @@ public class Eff_tangseng_AniEvent : MonoBehaviour
if (index >= hWK_TS_Boss.prizeCount)
{
//Destroy(hWK_TS_Boss.gameObject);
Pool.Instance.Return(hWK_TS_Boss.gameObject);
}
else
CreateFishManager.Instance.Id_DieFish_NotFX(hWK_TS_Boss.guid);
}
else
anim.Play("skill1");
}
@@ -50,7 +50,8 @@ public class Eff_tsgzSkill_AniEvent : MonoBehaviour
public void eventRotationEnd()
{
//Destroy(hHWK_TSGZ_Boss.gameObject);
Pool.Instance.Return(hHWK_TSGZ_Boss.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hHWK_TSGZ_Boss.guid);
}
public void eventShanAppear()
@@ -50,7 +50,7 @@ public class Eff_yilongSkill_AniEvent : MonoBehaviour
public void eventFallEnd()
{
//Destroy(hHWK_YL_BOSS.gameObject);
Pool.Instance.Return(hHWK_YL_BOSS.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hHWK_YL_BOSS.guid);
}
@@ -104,7 +104,7 @@ public class Eff_yilong_AniEvent : MonoBehaviour
public void AniEnd()
{
//CreateFishManager.Instance.Id_DieFish_NotFX(transform.parent.parent.GetComponent<MonsterContral>().guid);
Pool.Instance.Return(hHWK_YL_BOSS.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hHWK_YL_BOSS.guid);
}
/*
@@ -109,7 +109,7 @@ public class Eff_zhubajie_Skill_AniEvent : MonoBehaviour
}
public void AniEnd()
{
Pool.Instance.Return(hWK_ZBJ_Boss.gameObject);
CreateFishManager.Instance.Id_DieFish_NotFX(hWK_ZBJ_Boss.guid);
}