新增剔除功能与剔除着色器
parent
be53fd73d5
commit
b046d6a924
|
@ -649,6 +649,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 +669,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 +685,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 +709,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
|
||||||
|
@ -1862,6 +1894,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 +1938,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 +1970,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: []
|
||||||
|
|
|
@ -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,33 @@ 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)
|
||||||
|
{
|
||||||
|
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()
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 08e1cc37db7c5ac4a8d66457f42890aa
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
@ -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
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3343779955ffd742acdd608325838cd
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
|
Loading…
Reference in New Issue