Replace TownSquare with HomeCamp art and land humanoid bots, LittleBear, and LmGirl review assets.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,7 @@ using YooAsset;
|
||||
namespace HotUpdate
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载人物角色 CaoCao 进广场(地址 CaoCao)。
|
||||
/// 加载人物角色 CaoCao 的独立预览(地址 CaoCao)。
|
||||
/// </summary>
|
||||
public sealed class CharacterSpawner : MonoBehaviour
|
||||
{
|
||||
@@ -67,8 +67,7 @@ namespace HotUpdate
|
||||
|
||||
_instance = Instantiate(prefab);
|
||||
_instance.name = "CaoCao_Runtime";
|
||||
var plaza = GameObject.Find("TownSquare_Runtime");
|
||||
var y = GroundSit.Height(Vector3.zero, plaza != null ? plaza.transform : null);
|
||||
var y = GroundSit.Height(Vector3.zero, null);
|
||||
_instance.transform.position = new Vector3(0f, y, 0f);
|
||||
DontDestroyOnLoad(_instance);
|
||||
|
||||
@@ -82,7 +81,7 @@ namespace HotUpdate
|
||||
billboardTf.rotation = Quaternion.LookRotation(-dir.normalized);
|
||||
}
|
||||
|
||||
if (GameObject.Find("TownSquare_Runtime") == null && Camera.main != null)
|
||||
if (Camera.main != null)
|
||||
{
|
||||
var cam = Camera.main;
|
||||
cam.transform.position = new Vector3(0f, 1.2f, -2.2f);
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using System.Collections;
|
||||
using AOT.Boot;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
|
||||
namespace HotUpdate
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载小镇广场环境,供角色站在广场中央。
|
||||
/// </summary>
|
||||
public sealed class TownSquareSpawner : MonoBehaviour
|
||||
{
|
||||
public const string PrefabAddress = "TownSquare";
|
||||
public const string EditorPrefabPath = "Assets/Bundles/Scenes/Town/TownSquare/TownSquare.prefab";
|
||||
public const string ArtPackageName = "Art";
|
||||
|
||||
BootContext _ctx;
|
||||
GameObject _instance;
|
||||
|
||||
public void Bind(BootContext ctx) => _ctx = ctx;
|
||||
|
||||
public IEnumerator SpawnCo()
|
||||
{
|
||||
GameObject prefab = null;
|
||||
|
||||
if (YooAssets.IsInitialized && YooAssets.TryGetPackage(ArtPackageName, out var art) &&
|
||||
art.InitializeStatus == EOperationStatus.Succeeded)
|
||||
{
|
||||
var handle = art.LoadAssetAsync<GameObject>(PrefabAddress);
|
||||
yield return handle;
|
||||
if (handle.Status == EOperationStatus.Succeeded)
|
||||
prefab = handle.GetAssetObject<GameObject>();
|
||||
else
|
||||
handle.Release();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (prefab == null)
|
||||
prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(EditorPrefabPath);
|
||||
#endif
|
||||
|
||||
if (prefab == null)
|
||||
{
|
||||
Debug.LogError("[TownSquareSpawner] TownSquare prefab not found");
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (_instance != null)
|
||||
Destroy(_instance);
|
||||
|
||||
_instance = Instantiate(prefab);
|
||||
_instance.name = "TownSquare_Runtime";
|
||||
DontDestroyOnLoad(_instance);
|
||||
|
||||
if (Camera.main != null)
|
||||
{
|
||||
var cam = Camera.main;
|
||||
cam.transform.position = new Vector3(0f, 12f, -22f);
|
||||
cam.transform.rotation = Quaternion.Euler(28f, 0f, 0f);
|
||||
cam.fieldOfView = 40f;
|
||||
cam.backgroundColor = new Color(0.78f, 0.88f, 0.94f);
|
||||
}
|
||||
|
||||
Debug.Log($"[TownSquareSpawner] spawned ok res={_ctx?.ResVersion}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 561555ac8c9a26a498a4416023b2810e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user