PP 2025-01-10 12:18:04 +08:00
commit caf3f18c5c
9 changed files with 5053 additions and 77 deletions

View File

@ -270,6 +270,11 @@ MonoBehaviour:
target: {fileID: 223334192} target: {fileID: 223334192}
rotateSpeed: -30 rotateSpeed: -30
FreeTime: 30 FreeTime: 30
--- !u!224 &241816543 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5626654763991164890, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
m_PrefabInstance: {fileID: 495605761}
m_PrefabAsset: {fileID: 0}
--- !u!1 &251978103 --- !u!1 &251978103
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -641,6 +646,14 @@ PrefabInstance:
propertyPath: m_Value propertyPath: m_Value
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4392250051589012096, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: uiCanvas
value:
objectReference: {fileID: 1277526996}
- target: {fileID: 4392250051589012096, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: uiTriggerBtn
value:
objectReference: {fileID: 1299667255}
- target: {fileID: 4392250051589012096, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - target: {fileID: 4392250051589012096, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: typewriterPrefab propertyPath: typewriterPrefab
value: value:
@ -649,6 +662,14 @@ PrefabInstance:
propertyPath: componentTextParent propertyPath: componentTextParent
value: value:
objectReference: {fileID: 1521878370} objectReference: {fileID: 1521878370}
- target: {fileID: 4467637909231862192, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4467637909231862192, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4467637909231862192, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - target: {fileID: 4467637909231862192, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0.000029087067 value: 0.000029087067
@ -661,6 +682,14 @@ PrefabInstance:
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7024480808377725595, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7024480808377725595, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7571798407419741986, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - target: {fileID: 7571798407419741986, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
value: 0 value: 0
@ -669,6 +698,14 @@ PrefabInstance:
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7571798407419741986, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7571798407419741986, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8557856746393510970, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - target: {fileID: 8557856746393510970, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
value: 0 value: 0
@ -685,6 +722,14 @@ PrefabInstance:
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8557856746393510970, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8557856746393510970, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8709297164818035694, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - target: {fileID: 8709297164818035694, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 46.30005 value: 46.30005
@ -744,6 +789,9 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 5626654763991164890, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
insertIndex: 1
addedObject: {fileID: 1299667254}
- targetCorrespondingSourceObject: {fileID: 6461988665235398496, guid: fbd98df1f6ab257439fff069ae185281, type: 3} - targetCorrespondingSourceObject: {fileID: 6461988665235398496, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1311624461} addedObject: {fileID: 1311624461}
@ -1423,11 +1471,136 @@ MonoBehaviour:
target: {fileID: 668196392} target: {fileID: 668196392}
rotateSpeed: 0.1 rotateSpeed: 0.1
FreeTime: 1 FreeTime: 1
--- !u!1 &1277526996 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8092749453836692299, guid: fbd98df1f6ab257439fff069ae185281, type: 3}
m_PrefabInstance: {fileID: 495605761}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1288110412 stripped --- !u!1 &1288110412 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 2881457540606939832, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} m_CorrespondingSourceObject: {fileID: 2881457540606939832, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
m_PrefabInstance: {fileID: 6664335491598370550} m_PrefabInstance: {fileID: 6664335491598370550}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1299667253
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1299667254}
- component: {fileID: 1299667257}
- component: {fileID: 1299667256}
- component: {fileID: 1299667255}
m_Layer: 5
m_Name: UITriggerBtn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1299667254
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1299667253}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 241816543}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -39.4, y: 124.9}
m_SizeDelta: {x: 112, y: 53.6451}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1299667255
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1299667253}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1299667256}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1299667256
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1299667253}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1299667257
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1299667253}
m_CullTransparentMesh: 1
--- !u!1 &1311624460 --- !u!1 &1311624460
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1862,6 +2035,10 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 227347454680306346, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 251226097386157602, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} - target: {fileID: 251226097386157602, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -1902,6 +2079,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2881457540606939832, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4332512220139617832, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} - target: {fileID: 4332512220139617832, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0.03 value: -0.03
@ -1930,18 +2111,46 @@ PrefabInstance:
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4685081995603142786, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4830004066221561861, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} - target: {fileID: 4830004066221561861, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4880362198375544271, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5048207471782671204, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5218155922998809704, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} - target: {fileID: 5218155922998809704, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: "\u6839\u8282\u70B9(\u4E0D\u8981\u4FEE\u6539\u4F4D\u7F6E)" value: "\u6839\u8282\u70B9(\u4E0D\u8981\u4FEE\u6539\u4F4D\u7F6E)"
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6009124418285241141, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6720075688575866809, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7574252367231446458, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3} - target: {fileID: 7574252367231446458, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: "\u8F66\u8F86Body(\u53EF\u4EE5\u4FEE\u6539\u5750\u6807\u4E0E\u65CB\u8F6C)" value: "\u8F66\u8F86Body(\u53EF\u4EE5\u4FEE\u6539\u5750\u6807\u4E0E\u65CB\u8F6C)"
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8356284782624027731, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9210105406907489482, guid: 741d148cf7fe4db4aa6687915c30f4ca, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
@ -41,14 +42,18 @@ public class Main : MonoBehaviour
private void HideAllCars() private void HideAllCars()
{ {
StopAllCoroutines();
foreach (var configCar in config.Cars) foreach (var configCar in config.Cars)
{ {
configCar..SetActive(false); // SetCarActiveCoroutine()
SetCarActive(configCar.,false);
// configCar.车辆基础物体.SetActive(false);
foreach (var carComponentConfig in configCar.) foreach (var carComponentConfig in configCar.)
{ {
foreach (var component in carComponentConfig.) foreach (var component in carComponentConfig.)
{ {
component..SetActive(false); SetCarActive(component.,false);
// component.物体.SetActive(false);
} }
} }
} }
@ -63,7 +68,9 @@ public class Main : MonoBehaviour
carComponentConfig.SelectComponentIndex = 0; carComponentConfig.SelectComponentIndex = 0;
for (var j = 0; j < carComponentConfig..Count; j++) for (var j = 0; j < carComponentConfig..Count; j++)
{ {
carComponentConfig.[j]..SetActive(j == 0); var go = carComponentConfig.[j].;
SetCarActive(go, j == 0);
// carComponentConfig.车辆组件合集[j].物体.SetActive(j == 0);
} }
} }
@ -103,20 +110,24 @@ public class Main : MonoBehaviour
if (carIndex == -1) if (carIndex == -1)
return; return;
var configCar = config.Cars[carIndex]; var configCar = config.Cars[carIndex];
configCar..SetActive(isActive); // configCar.车辆基础物体.SetActive(isActive);
SetCarActive(configCar.,isActive);
foreach (var carComponentConfig in configCar.) foreach (var carComponentConfig in configCar.)
{ {
if (isActive) if (isActive)
{ {
if (carComponentConfig..Count <= carComponentConfig.SelectComponentIndex) if (carComponentConfig..Count <= carComponentConfig.SelectComponentIndex)
continue; continue;
carComponentConfig.[carComponentConfig.SelectComponentIndex]..SetActive(true); var go = carComponentConfig.[carComponentConfig.SelectComponentIndex].;
SetCarActive(go,true);
// carComponentConfig.车辆组件合集[carComponentConfig.SelectComponentIndex].物体.SetActive(true);
} }
else else
{ {
foreach (var component in carComponentConfig.) foreach (var component in carComponentConfig.)
{ {
component..SetActive(false); // component.物体.SetActive(false);
SetCarActive(component.,false);
} }
} }
} }
@ -178,7 +189,34 @@ public class Main : MonoBehaviour
{ {
if (componentIndex == -1) if (componentIndex == -1)
return; return;
currentCarComponents.[componentIndex]..SetActive(isDisplay); var go = currentCarComponents.[componentIndex].;
// go.SetActive(isDisplay);
SetCarActive(go, isDisplay);
}
private void SetCarActive(GameObject go, bool isActive)
{
go.SetActive(isActive);
// Debug.Log($"SetCarActive ({go.name}) ({isActive})");
// this.StartCoroutine(SetCarActiveCoroutine(go, isActive, .5f));
}
private IEnumerator SetCarActiveCoroutine(GameObject go, bool isActive, float time)
{
var renderers = go.GetComponentsInChildren<Renderer>();
var propertyToID = Shader.PropertyToID("_ClipScaleV");
float timer = 0;
float min = -1f;
float max = 1.0f;
while (timer < time)
{
timer += Time.deltaTime;
yield return null;
var evl = timer / time;
float result = isActive ? Mathf.Lerp(max, min, evl) : Mathf.Lerp(min, max, evl);
foreach (var r in renderers)
r.material.SetFloat(propertyToID, result);
}
} }
private void Awake() private void Awake()

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using YogiGameCore.ComponentEx; using YogiGameCore.ComponentEx;
using YogiGameCore.Utils; using YogiGameCore.Utils;
@ -27,6 +28,9 @@ public class GamePanel : MonoBehaviour
/// </summary> /// </summary>
private string componentConfigName; private string componentConfigName;
[SerializeField] private Button uiTriggerBtn;
[SerializeField] private GameObject uiCanvas;
private void ClearAllComponentDisplayText() private void ClearAllComponentDisplayText()
{ {
Debug.Log("清空车辆所有文本信息"); Debug.Log("清空车辆所有文本信息");
@ -65,6 +69,10 @@ public class GamePanel : MonoBehaviour
this.main.OnCarChanged += OnMainOnOnCarChanged; this.main.OnCarChanged += OnMainOnOnCarChanged;
this.main.OnCarComponentConfigChanged += OnCarComponentConfigChanged; this.main.OnCarComponentConfigChanged += OnCarComponentConfigChanged;
this.main.OnSwitchComponent += OnSwitchComponent; this.main.OnSwitchComponent += OnSwitchComponent;
uiTriggerBtn.onClick.AddListener(() =>
{
uiCanvas.SetActive(!uiCanvas.activeSelf);
});
} }
private void Start() private void Start()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 08e1cc37db7c5ac4a8d66457f42890aa
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d3343779955ffd742acdd608325838cd
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}