This commit is contained in:
杨号敬 2024-12-25 11:12:33 +08:00
commit 0cbeeaa200
21 changed files with 1975 additions and 77 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 791d21ac34833d243adbd2370abb7375
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 04d8d49b4b0957f40833bbfb8718f451
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

View File

@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: fdbd0836371595d46aad3d711a72f08d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 7a69175e85b068a4ebe50630f2bb7d87
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 1becbe0696cf16946bf3a00a0909c483
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 828 B

View File

@ -6,6 +6,7 @@ using UnityEngine.UI;
using System.Threading.Tasks;
public class Panel2 : MonoBehaviour
{
public static Panel2 instance;
private Toggle toggle;//角色名是否出现
private Button follow;//跟随查按钮
private Button end;//结束按钮
@ -16,11 +17,14 @@ public class Panel2 : MonoBehaviour
private GameObject peopleposition;
public Camera godView; // 上帝视角的位置
public List<Camera> playerCameras = new List<Camera>(); // 存储每个角色的摄像机
private bool isGodView = true; // 是否为上帝视角
public int currentCameraIndex = -1;
// Start is called before the first frame update
void Start()
{
instance = this;
godView=GameObject.Find("TopCamera").GetComponent<Camera>();
toggle =transform.Find("right/under/Toggle").GetComponent<Toggle>();
toggle.onValueChanged.AddListener(OnToggleValueChanged);
@ -30,7 +34,7 @@ public class Panel2 : MonoBehaviour
follow.onClick.AddListener(FollowBtn);
end = transform.Find("left/btn_enddrill").GetComponent<Button>();
end.onClick.AddListener(EndBtn);
peopleposition = GameObject.Find("peopleposition").gameObject;
//获取所有子物体中的 Button 组件
nameImage = new List<GameObject>();
@ -43,9 +47,46 @@ public class Panel2 : MonoBehaviour
nameImage.Add(bgTransform.gameObject);
}
}
// 默认执行一次切换
OnToggleValueChanged(toggle.isOn);
// 获取所有标签为 "People" 的物体
GameObject[] players = GameObject.FindGameObjectsWithTag("People");
// 遍历每个 Player找到子物体中的摄像机
foreach (GameObject player in players)
{
// 在 Player 的子物体中查找摄像机组件
Camera camera = player.GetComponentInChildren<Camera>();
if (camera != null)
{
playerCameras.Add(camera);
camera.enabled = false; // 初始化时禁用所有摄像机
}
}
// 默认执行一次切换
OnToggleValueChanged(toggle.isOn);
}
// 切换到指定索引的摄像机
public void SwitchToCamera(int index)
{
var index2=index;
if (index < 0 || index >= playerCameras.Count)
{
Debug.LogWarning("无效的摄像机索引:" + index);
return;
}
// 关闭上帝视角摄像机
godView.enabled=false;
isGodView = false;
// 禁用当前激活的摄像机(如果在角色视角)
if (currentCameraIndex >= 0)
{
playerCameras[index2].enabled=false;
}
// 激活指定索引的摄像机
currentCameraIndex = index;
playerCameras[currentCameraIndex].enabled=true;
}
// 用于外部传入参数来设置Dropdown选项数量的方法
public void SetOptionCount(int count)
@ -80,8 +121,9 @@ public class Panel2 : MonoBehaviour
//peopleposition.SetActive(false);
int selectedIndex = dropdown.value;
Debug.Log("进入角色" + (selectedIndex+1) + "视角");
godView.enabled = false;
SwitchToCamera(selectedIndex);//转入视角
Game.uiManager.CloseUI("Panel1_2");
Game.uiManager.ShowUI<Image>("Panel1_3");
}

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static UnityEditor.Experimental.GraphView.GraphView;
public class Panel3 : MonoBehaviour
{
@ -11,7 +12,12 @@ public class Panel3 : MonoBehaviour
private Dropdown dropdown;
private int optionCount; // 用于存储传入的确定Dropdown选项数量的参数
private GameObject peopleposition;
private Camera godview;
private Camera godView;
public List<Camera> playerCameras = new List<Camera>(); // 存储每个角色的摄像机
private int currentCameraIndex = -1;
private bool isGodView = false; // 是否当前为上帝视角
private GameObject[] players;
// Start is called before the first frame update
void Start()
{
@ -24,8 +30,66 @@ public class Panel3 : MonoBehaviour
follow.onClick.AddListener(FollowBtn);
peopleposition = GameObject.Find("peopleposition").gameObject;
peopleposition.SetActive(false);
godview=GameObject.Find("TopCamera").GetComponent<Camera>();
godView=GameObject.Find("TopCamera").GetComponent<Camera>();
// 获取所有标签为 "Player" 的物体
GameObject[] players = GameObject.FindGameObjectsWithTag("People");
foreach (GameObject player in players)
{
Camera camera = player.GetComponentInChildren<Camera>();
if (camera != null)
{
playerCameras.Add(camera);
camera.enabled = true; // 初始化时禁用所有角色摄像机
}
}
currentCameraIndex = Panel2.instance.currentCameraIndex;
for(int i = 0; i < playerCameras.Count; i++)
{
if(i!=currentCameraIndex)
{
playerCameras[i].enabled = false;
}
}
}
// 切换到指定索引的摄像机
public void SwitchToCamera(int index)
{
if (index < 0 || index >= playerCameras.Count)
{
Debug.LogWarning("无效的摄像机索引:" + index);
return;
}
// 禁用上帝视角摄像机
godView.enabled = false;
// 禁用所有角色摄像机
foreach (var camera in playerCameras)
{
camera.enabled = false;
}
// 激活目标角色摄像机
currentCameraIndex = index;
playerCameras[index].enabled = true;
isGodView = false; // 标记为非上帝视角
}
// 切换到上帝视角
public void SwitchToGodView()
{
// 禁用所有角色摄像机
foreach (var camera in playerCameras)
{
camera.enabled=false;
}
// 激活上帝视角摄像机
godView.enabled = true;
isGodView = true;
currentCameraIndex = -1;
}
// 用于外部传入参数来设置Dropdown选项数量的方法
public void SetOptionCount(int count)
@ -49,7 +113,8 @@ public class Panel3 : MonoBehaviour
{
peopleposition.gameObject.SetActive(true);
//返回上帝视角界面
godview.enabled = true;
SwitchToGodView();
// Camera.main.enabled = true;
Game.uiManager.ShowUI<Image>("Panel1_2");
Game.uiManager.CloseUI("Panel1_3");
}
@ -60,8 +125,11 @@ public class Panel3 : MonoBehaviour
}
void FollowBtn()
{
//转化角色视角
int selectedIndex = dropdown.value;
Debug.Log("进入角色" + (selectedIndex+1) + "视角");
SwitchToCamera(selectedIndex);
}
}

View File

@ -5576,7 +5576,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1785748703130119632, guid: 6025bf38a7ada134281ba43ad08c154b, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9194197327704083339, guid: 6025bf38a7ada134281ba43ad08c154b, type: 3}
propertyPath: m_Animations.Array.size
@ -17855,6 +17855,7 @@ MonoBehaviour:
firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3}
water: {fileID: 0}
IShavewater: 0
CharacterControl: {fileID: 0}
UseSkill: {fileID: 0}
--- !u!1001 &1402705621
PrefabInstance:
@ -22382,6 +22383,7 @@ MonoBehaviour:
scrollSpeed: 2
overlookPosition: {x: 0, y: 50, z: 0}
overlookRotation: {x: -0.45922917, y: 0.5376882, z: -0.5376882, w: -0.45922917}
Canvas: {fileID: 0}
--- !u!1001 &1709243970
PrefabInstance:
m_ObjectHideFlags: 0
@ -24246,6 +24248,7 @@ MonoBehaviour:
firewater: {fileID: 8607906409360804035, guid: b5be25eadef55294691fff85129cc656, type: 3}
water: {fileID: 0}
IShavewater: 0
CharacterControl: {fileID: 0}
UseSkill: {fileID: 382802817}
--- !u!1001 &1875190416
PrefabInstance:

File diff suppressed because it is too large Load Diff