etienne cella
5 年前
当前提交
2dd2f607
共有 4 个文件被更改,包括 92 次插入 和 8 次删除
-
4Assets/ClusterDisplay/Scripts/CustomDepthBuffer.cs
-
53Assets/Scenes/Demo/Demo.unity
-
32Assets/ClusterDisplay/Scripts/KonamiCode.cs
-
11Assets/ClusterDisplay/Scripts/KonamiCode.cs.meta
|
|||
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; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c9d3b08703a3f2545b455a8aa6aa3b53 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue