Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created December 22, 2019 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/0c0468989ad7716e05a9681c434e22c5 to your computer and use it in GitHub Desktop.
Save tsubaki/0c0468989ad7716e05a9681c434e22c5 to your computer and use it in GitHub Desktop.
Micro Game のScheduleの挙動
using System.Collections;
using System.Collections.Generic;
using Platformer.Core;
using UnityEngine;
using static Platformer.Core.Simulation;
public class MySchedule : MonoBehaviour
{
void Start()
{
MyTask.OnExecute += (c) =>
{
Debug.Log(c.player.name);
};
}
void Update()
{
Schedule<MyTask>().player = gameObject;
}
}
public class MyTask : Simulation.Event<MyTask>
{
public GameObject player;
public override void Execute()
{
Debug.Log("DO");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment