[A] Tessellattion

This commit is contained in:
2024-07-19 21:39:29 +08:00
parent 56a1e3da98
commit 3758ba0a99
17 changed files with 1785 additions and 109 deletions

View File

@@ -27,7 +27,7 @@ public class FPS : MonoBehaviour
void Start()
{
Application.targetFrameRate = 0;
Application.targetFrameRate = 60;
}
void OnGUI()
@@ -47,4 +47,15 @@ public class FPS : MonoBehaviour
Rect rect = new Rect(20, h * 0.4f, w * 0.5f, h * 2 / 100);
GUI.Label(rect, text, fpsStyle);
}
public GameObject[] objs;
[ContextMenu("Switch")]
void Switch()
{
foreach (var obj in objs)
{
obj.SetActive(!obj.activeSelf);
}
}
}

View File

@@ -7,6 +7,9 @@ using UnityEngine;
public class TestUI : MonoBehaviour
{
public TMP_Dropdown QualityDropdown;
public TMP_Dropdown waterSwitch;
public GameObject[] Waters;
private void OnEnable()
{
@@ -19,5 +22,20 @@ public class TestUI : MonoBehaviour
QualityDropdown.AddOptions(QualitySettings.names.ToList());
QualityDropdown.value = QualitySettings.GetQualityLevel();
QualityDropdown.onValueChanged.AddListener(index => QualitySettings.SetQualityLevel(index));
waterSwitch.ClearOptions();
waterSwitch.AddOptions(Waters.Select(_ => _.name).ToList());
waterSwitch.value = 0;
OnWaterChange(0);
waterSwitch.onValueChanged.AddListener(OnWaterChange);
}
private void OnWaterChange(int index)
{
for(int i = 0; i < Waters.Length; i++)
{
Waters[i].SetActive(i == index);
}
}
}

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,18 +0,0 @@
fileFormatVersion: 2
guid: 154c6496b574b495eaf1e56696d041c5
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: eb1723d9808f34b8fa4c8c24d2a380d9, type: 3}
waterMesh:
shape: 0
scale: 100
vertexDistance: 2
UVTiling: 1
noise: 0
boundsPadding: 4
mesh: {fileID: -8670151273213183110, guid: 154c6496b574b495eaf1e56696d041c5, type: 3}