示例#1
0
 protected override void AttacheEventsToControls(Controls controls, AttractControl attract)
 => attract.InteractStarted += (s, cc) => {
     attract.gameObject.SetActive(false);
     SharedGame.AccessWithRetry((c) => {
         c.QuickStart.gameObject.SetActive(true);
         c.QuickStart.enabled = true;
     });
 };
示例#2
0
 protected override void AttacheEventsToControls(Controls controls, MenuOneDimensionControl menu)
 {
     menu.ForwardStarted  += (s, c) => index++;
     menu.BackwardStarted += (s, c) => index--;
     menu.CancelStarted   += (s, cc) => {
         menu.gameObject.SetActive(false);
         SharedGame.AccessWithRetry((c) => {
             c.Attract.gameObject.SetActive(true);
             c.Attract.enabled = true;
         });
     };
     menu.ConfirmStarted += (s, c) => menu.Choose(index);
 }
    public void OnEnable() => SharedGame.AccessWithRetry(g => {
        g.Attract.gameObject.SetActive(true);
        g.Attract.enabled      = true;
        g.QuickStart.OnChoice += (s, choice) => {
            switch ((QuickStart.Choice)choice)
            {
            case (QuickStart.Choice.yes):
                SceneManager.LoadScene(JapaneseMaple.name);
                break;

            case (QuickStart.Choice.no):
                SceneManager.LoadScene(MenuScene.name);
                break;

            default:
                Debug.LogWarning($"Unexepected 3rd option '{choice}'");
                break;
            }
        };
    });
示例#4
0
 protected void DetachFromGame() =>
 SharedGame.AccessWithRetry(g => typeof(SharedGame).GetProperty(GetType().Name).SetValue(g, null));
示例#5
0
 protected void AttachToGame <T>(T value) =>
 SharedGame.AccessWithRetry(g => typeof(SharedGame).GetProperty(GetType().Name).SetValue(g, value));