修改人物检视功能,修改对话框功能并修改关联脚本

This commit is contained in:
YangHua 2024-08-23 08:36:27 +08:00
parent ebf4a433ba
commit 805da9f73d
23 changed files with 1867 additions and 95 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1,132 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: OutLineImage
m_Shader: {fileID: 4800000, guid: c2bd79b9cd62adb49973f4d6fa0b8b79, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 916e6bb16397f3a45a993e3c38541a80, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 2800000, guid: a1606d34a052ed3449da93edd229743e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Outline: 0.0133
- _OutlineWidth: 4.49
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 0.95283014, g: 0.8758825, b: 0.040450297, a: 0.64705884}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &8894918244741498972
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b7ffb9384b38fb54d9a74ce98c08454f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,111 @@
Shader "Custom/OutLineShader"
{
Properties
{
_MainTex("Base (RGB)", 2D) = "white" {}
_OutlineColor("Outline Color", Color) = (.0, .0, .0, .0)
_OutlineWidth("Outline Width", Range(0, 10)) = .0
_MaskTex("Mask Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType" = "Overlay" }
Pass
{
Name "OUTLINE"
ZWrite Off
ZTest Always
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Stencil
{
Ref 1
Comp Always
Pass Replace
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : POSITION;
};
float _OutlineWidth;
float4 _OutlineColor;
sampler2D _MaskTex;
v2f vert(appdata v)
{
v2f o;
float2 offset = float2(_OutlineWidth / _ScreenParams.x, _OutlineWidth / _ScreenParams.y);
o.pos = UnityObjectToClipPos(v.vertex) + float4(offset, 0, 0) * v.vertex.w;
return o;
}
half4 frag(v2f i) : COLOR
{
// Apply mask texture to control where the outline is visible
float mask = tex2D(_MaskTex, i.pos.xy / i.pos.w).r;
return _OutlineColor * mask;
}
ENDCG
}
Pass
{
Name "BASE"
ZWrite Off
ZTest Always
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Stencil
{
Ref 1
Comp Equal
Pass Keep
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
half4 frag(v2f i) : COLOR
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c2bd79b9cd62adb49973f4d6fa0b8b79
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
Shader "Custom/UIOutlineShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_OutlineColor ("Outline Color", Color) = (1,1,1,1)
_OutlineWidth ("Outline Width", Range(0.0, 10.0)) = 1.0
}
SubShader
{
Tags {"Queue"="Overlay" "IgnoreProjector"="True" "RenderType"="Transparent"}
Lighting Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 pos : POSITION;
float2 texcoord : TEXCOORD0;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _OutlineColor;
float _OutlineWidth;
v2f vert(appdata_t v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.texcoord = v.texcoord;
return o;
}
float4 frag(v2f i) : COLOR
{
float4 mainColor = tex2D(_MainTex, i.texcoord);
// Get texture size
float2 texelSize = float2(_OutlineWidth / _ScreenParams.x, _OutlineWidth / _ScreenParams.y);
// Sampling neighboring pixels
float alpha =
tex2D(_MainTex, i.texcoord + texelSize.xy).a +
tex2D(_MainTex, i.texcoord - texelSize.xy).a +
tex2D(_MainTex, i.texcoord + float2(-texelSize.x, texelSize.y)).a +
tex2D(_MainTex, i.texcoord + float2(texelSize.x, -texelSize.y)).a;
alpha = step(0.01, alpha) * (1 - mainColor.a);
float4 outlineColor = _OutlineColor * alpha;
return outlineColor + mainColor;
}
ENDCG
}
}
FallBack "Unlit/Transparent"
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ca85cb0f4ceccad4fb10e94f47821ec6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 4.6 MiB

View File

@ -0,0 +1,129 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1826117425740394722
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u7EDD\u7F18\u9774"
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DepthOnly
- SHADOWCASTER
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _Surface: 1
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -20,7 +20,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u9774\u5B502"
m_Name: "\u7EDD\u7F18\u9774"
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0bd66d44161ef1a48aacb60b56e482a3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -740,6 +740,10 @@ PrefabInstance:
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3824992726501166374, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3824992726501166374, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
propertyPath: m_IsActive
value: 1
@ -954,6 +958,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 9023546900043378599, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
m_PrefabInstance: {fileID: 810725974}
m_PrefabAsset: {fileID: 0}
--- !u!4 &810725979 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7414053543467013715, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
m_PrefabInstance: {fileID: 810725974}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &860489968
PrefabInstance:
m_ObjectHideFlags: 0
@ -2129,7 +2138,8 @@ MonoBehaviour:
toolParent: {fileID: 983777793}
headSlot: {fileID: 810725978}
bodySlot: {fileID: 810725977}
HandSlot: {fileID: 810725976}
handSlot: {fileID: 810725976}
shoesSlot: {fileID: 810725979}
--- !u!1 &2090806849
GameObject:
m_ObjectHideFlags: 0

View File

@ -10,7 +10,8 @@ public class TooRoomMannger : SingletonMono<TooRoomMannger>
public Transform toolParent;
public Transform headSlot;
public Transform bodySlot;
public Transform HandSlot;
public Transform handSlot;
public Transform shoesSlot;
private List<Material> _cancel; //灌누덖꼼醴헷
private List<Material> _wear; //누덖꼼醴헷
// Start is called before the first frame update
@ -51,10 +52,10 @@ public class TooRoomMannger : SingletonMono<TooRoomMannger>
bodySlot.GetComponent<SkinnedMeshRenderer>().material = ma;
break;
case "없鍍癎敬":
HandSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
handSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
break;
case "없鍍棄":
Debug.Log("Ñ¥×Ó");
shoesSlot.GetComponent<MeshRenderer>().material = ma;
break;
}
}

View File

@ -25,7 +25,6 @@ public class MobileController : PermanentTriggerBase
switch (downIndex)
{
case 0:
_highlight.SetHighlighted(false);
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerID, false) == 0)
{
GameManager.UIMgr.ShowPanel<UI_ReceiveTaskPanel>(E_UI_Layer.Mid, (panel) =>
@ -34,26 +33,27 @@ public class MobileController : PermanentTriggerBase
});
downIndex++;
}
_highlight.SetHighlighted(false);
break;
case 1:
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerID, false) == 0)
GameManager.UIMgr.ShowPanel<UI_PlayerSessionPanel>(E_UI_Layer.Mid, (panel) =>
{
GameManager.UIMgr.ShowPanel<UI_PlayerSessionPanel>(E_UI_Layer.Mid, (panel) =>
{
panel.Init(triggerID, "我是xxx供电所人员到xxx地方开展经互感器接入式低压电能计量装置安装作业。", PlayerTalk);
});
_highlight.SetHighlighted(false);
downIndex++;
}
panel.Init(triggerID, "我是xxx供电所人员到xxx地方开展经互感器接入式低压电能计量装置安装作业。", PlayerTalk);
});
_highlight.SetHighlighted(false);
downIndex = 0;
break;
}
}
private void PlayerTalk(int triggerID)
{
GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(E_UI_Layer.Mid, (panel) =>
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerID, true) == 0)
{
panel.Init(triggerID, "好的", null);
});
GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(E_UI_Layer.Mid, (panel) =>
{
panel.Init(triggerID, "好的", null);
});
}
}
}

View File

@ -13,11 +13,12 @@ public class UI_TopTipPanel : BasePanel
private float disappear = 5f;
public void Init(string title, string content)
{
disappear = 5f;
GetControl<TextMeshProUGUI>("Text_Title").text = title;
GetControl<TextMeshProUGUI>("Text_Content").text = content;
GetControl<TextMeshProUGUI>("Text_Content").GetComponent<ContentSizeFitter>().SetLayoutVertical();
var height = GetControl<TextMeshProUGUI>("Text_Content").rectTransform.sizeDelta.y + 60 + 40;
GetControl<Image>("Image_BackGround").rectTransform.sizeDelta = new Vector2(640 , height);
GetControl<Image>("Image_BackGround").rectTransform.sizeDelta = new Vector2(640, height);
Hide();
}
/// <summary>
@ -25,6 +26,7 @@ public class UI_TopTipPanel : BasePanel
/// </summary>
private void Hide()
{
StopCoroutine(HideAsync());
StartCoroutine(HideAsync());
}
private IEnumerator HideAsync()

25
Assets/Scripts/Test.cs Normal file
View File

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
public Color borderColor = Color.yellow;
public float borderWidth = 5f;
private void OnDrawGizmos()
{
RectTransform rt = GetComponent<RectTransform>();
if (rt != null)
{
Gizmos.color = borderColor;
Gizmos.DrawWireCube(rt.position, rt.sizeDelta + new Vector2(borderWidth * 2, borderWidth * 2));
}
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 35027ab99032d6748987a9bda5312d20
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: