Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/PreUpdateSystem.cs
Last active Apr 17, 2018

What would you like to do?
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Experimental.PlayerLoop;
using System.Collections.Generic;
public class PreUpdateSystem
static void Init()
var mySystem = new PlayerLoopSystem()
type = typeof(MyLoopSystemUpdate),
updateDelegate = () =>
Debug.Log("DO IT!!!");
var playerLoop = PlayerLoop.GetDefaultPlayerLoop();
var updateSystem = playerLoop.subSystemList[4]; // Update
var subSystem = new List<PlayerLoopSystem>(updateSystem.subSystemList);
subSystem.Insert(0, mySystem);
updateSystem.subSystemList = subSystem.ToArray();
playerLoop.subSystemList[4] = updateSystem;
public struct MyLoopSystemUpdate{ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.