Skip to content

Instantly share code, notes, and snippets.

@neonm3
neonm3 / GM.sc
Created April 6, 2020 16:34
Global Manager singleton if necessary
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GM : MonoBehaviour
{
public const int STAGE_ATTRACTOR = 1;
public const int STAGE_HUMAN_DETECTED = 2;
public const int STAGE_BUTTON_INTERACT = 3;
@neonm3
neonm3 / iosGaplessVideoPlayback.gist
Created August 22, 2017 12:08
gapless playback on IOS
NSURL *videoLoopUrl;
// as [[NSBundle mainBundle] URLForResource:@"assets/yourVideo" withExtension:@"mp4"]];
AVQueuePlayer *_loopVideoPlayer;
+(void) nextVideoInstance:(NSNotification*)notif
{
AVPlayerItem *currItem = [AVPlayerItem playerItemWithURL: videoLoopUrl];
[[NSNotificationCenter defaultCenter] addObserver:self