Created
December 22, 2019 08:46
-
-
Save tsubaki/0c0468989ad7716e05a9681c434e22c5 to your computer and use it in GitHub Desktop.
Micro Game のScheduleの挙動
This file contains 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 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