This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Exposes type utility functions. | |
* @packageDocumentation | |
*/ | |
/** | |
* Does `x` have an undefined property `prop`, | |
* or that property is `PropType`? | |
*/ | |
export function haveUndefienedPropertyOrThat< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasUndefienedPropertyOrThat< | |
PropType, | |
Prop extends string, | |
Base extends { [P in Prop]?: PropType } | |
>(p: (x: PropType | undefined) => x is PropType, x: Base, prop: Prop): boolean { | |
return x[prop] === undefined || p(x[prop]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not nullish | |
function f(): number { | |
return 10 | |
} | |
const x = f() ?? 20 // but ?? can use | |
console.log(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:10.15.0 | |
pipelines: | |
branches: | |
default: | |
- step: | |
name: Sanity check | |
caches: | |
- node | |
script: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UdonSharp; | |
using UnityEngine; | |
using VRC.Udon.Common.Interfaces; | |
using VRC.Udon; | |
/// <summary> | |
/// Sets a value with network users. | |
/// | |
/// NOTE: | |
/// Don't use DoSetValueTo*() directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UdonSharp; | |
using UnityEngine; | |
using VRC.SDKBase; | |
using VRC.Udon; | |
public class PlayPauseAudioSource : UdonSharpBehaviour { | |
public AudioSource audio; | |
private bool hasPlayed = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UdonSharp; | |
using UnityEngine; | |
using VRC.SDKBase; | |
using VRC.Udon; | |
public class Switch4OrNothing : UdonSharpBehaviour { | |
public GameObject first; | |
public GameObject second; | |
public GameObject third; | |
public GameObject fourth; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UdonSharp; | |
using UnityEngine; | |
using VRC.SDKBase; | |
using VRC.Udon; | |
public class Switch4OrNothing : UdonSharpBehaviour { | |
public GameObject first; | |
public GameObject second; | |
public GameObject third; | |
public GameObject fourth; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UdonSharp; | |
using UnityEngine; | |
using VRC.SDKBase; | |
using VRC.Udon; | |
public class MirroSwitchMock : UdonSharpBehaviour { | |
public GameObject mirror; | |
public override void Interact() { | |
if (this.mirror == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
public static void main(String[] args) { | |
float[] xs = new float[32]; | |
xs[5] = 10.0f; | |
for (float x : xs) { | |
System.out.println(x); | |
} | |
} | |
} |