(client) chore:Clean code
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Base;
|
||||
using Data;
|
||||
using Entity;
|
||||
using Prefab;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
@ -45,7 +45,7 @@ namespace Managers
|
||||
|
||||
/// <summary> 子弹实体的预制体。 </summary>
|
||||
public EntityPrefab bulletPrefab;
|
||||
|
||||
|
||||
public EntityPrefab pickupPrefab;
|
||||
|
||||
/// <summary> 默认实体的预制体,用于生成失败时的回退。 </summary>
|
||||
@ -269,7 +269,7 @@ namespace Managers
|
||||
throw new InvalidOperationException(
|
||||
$"在 '{instantiatedEntity.name}' 上缺少 EntityPrefab 组件,无法完成实体初始化。");
|
||||
}
|
||||
entityComponent.entity.currentDimensionId=dimensionId;
|
||||
entityComponent.entity.currentDimensionId = dimensionId;
|
||||
entityComponent.Init(def);
|
||||
extraInit?.Invoke(entityComponent);
|
||||
|
||||
@ -504,14 +504,14 @@ namespace Managers
|
||||
Debug.LogError($"实体管理器:无法在维度 '{dimensionId}' 中获取或创建实体的父层。");
|
||||
return;
|
||||
}
|
||||
|
||||
var result=Instantiate(pickupPrefab, pos, Quaternion.identity);
|
||||
|
||||
var result = Instantiate(pickupPrefab, pos, Quaternion.identity);
|
||||
var pickup = result.GetComponent<Pickup>();
|
||||
result.transform.SetParent(parentLayer);
|
||||
pickup.Init(itemDef);
|
||||
if (result == null) GenerateDefaultEntity(dimensionId, pos);
|
||||
_pendingAdditions.Add(Tuple.Create(dimensionId, "default", result));
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 在指定维度和位置生成一个默认实体(通常作为回退选项)。
|
||||
|
Reference in New Issue
Block a user