浏览代码

add konami code, modify debug controls

/cinematic-demo-ME
etienne cella 5 年前
当前提交
2dd2f607
共有 4 个文件被更改,包括 92 次插入8 次删除
  1. 4
      Assets/ClusterDisplay/Scripts/CustomDepthBuffer.cs
  2. 53
      Assets/Scenes/Demo/Demo.unity
  3. 32
      Assets/ClusterDisplay/Scripts/KonamiCode.cs
  4. 11
      Assets/ClusterDisplay/Scripts/KonamiCode.cs.meta

4
Assets/ClusterDisplay/Scripts/CustomDepthBuffer.cs


void Update()
{
// TMP DEBUG hack
if (Input.GetKeyDown(KeyCode.G))
// TMP DEBUG hack, show depth buffer on leftCtrl+G
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.G))
m_ShowDebugUI = !m_ShowDebugUI;
m_Sampler.Begin();

53
Assets/Scenes/Demo/Demo.unity


- {fileID: 2019830148}
- {fileID: 972758097}
- {fileID: 1581134559}
- {fileID: 690275910}
m_Father: {fileID: 411413927}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_MeshRenderer: {fileID: 519814091}
m_MeshFilter: {fileID: 519814092}
m_Light: {fileID: 0}
m_CustomDepthBufferId:
OcclusionRadius: 1
NearFadeStartDistance: 1
NearFadeEndDistance: 3

m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &690275909
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 690275910}
- component: {fileID: 690275911}
m_Layer: 0
m_Name: KonamiCodeUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &690275910
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690275909}
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_Children: []
m_Father: {fileID: 235032663}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &690275911
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690275909}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c9d3b08703a3f2545b455a8aa6aa3b53, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TargetObject: {fileID: 2019830147}
m_Code: lightui
--- !u!1 &699548296
GameObject:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
m_ClusterRenderer: {fileID: 832040623}
m_Show: 0
m_ToggleKey: 104
m_DisplayUpdateRate: 1
--- !u!114 &832040622
MonoBehaviour:

m_MeshRenderer: {fileID: 1614826917}
m_MeshFilter: {fileID: 1614826918}
m_Light: {fileID: 0}
m_CustomDepthBufferId:
OcclusionRadius: 1
NearFadeStartDistance: 1
NearFadeEndDistance: 3

m_MeshRenderer: {fileID: 1619976217}
m_MeshFilter: {fileID: 1619976218}
m_Light: {fileID: 0}
m_CustomDepthBufferId:
OcclusionRadius: 12
NearFadeStartDistance: 1
NearFadeEndDistance: 3

m_MeshRenderer: {fileID: 1804604714}
m_MeshFilter: {fileID: 1804604715}
m_Light: {fileID: 0}
m_CustomDepthBufferId:
OcclusionRadius: 1
NearFadeStartDistance: 1
NearFadeEndDistance: 3

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2019830148
RectTransform:
m_ObjectHideFlags: 0

32
Assets/ClusterDisplay/Scripts/KonamiCode.cs


using System;
using UnityEngine;
public class KonamiCode : MonoBehaviour
{
[SerializeField]
GameObject m_TargetObject;
[SerializeField]
string m_Code;
int m_Index;
void OnEnable() { m_Index = 0; }
void Update()
{
if (m_TargetObject == null)
return;
foreach (var c in Input.inputString)
{
m_Index = c == m_Code[m_Index] ? m_Index + 1 : 0;
if (m_Index == m_Code.Length - 1)
{
m_TargetObject.SetActive(!m_TargetObject.activeSelf);
m_Index = 0;
}
}
}
}

11
Assets/ClusterDisplay/Scripts/KonamiCode.cs.meta


fileFormatVersion: 2
guid: c9d3b08703a3f2545b455a8aa6aa3b53
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存