Пример #1
0
    // Use this for initialization
    void Start()
    {
        var test = (GameModel)ApplicationFacade.instance.GetModel <GameModel>();

        TestButtonText.text = test.OtherViewText;

        var e = new NavigationEvents.LoadContextEvent(new MainContext(), true);

        TestButton.onClick.AddListener(delegate
        {
            EventSystem.instance.Dispatch(e);
        });

        var event2 = new NavigationEvents.PreviousContextEvent();

        BackButton.onClick.AddListener(delegate
        {
            EventSystem.instance.Dispatch(event2);
        });

        var popup  = AssetDatabase.instance.GetAsset <PopupAsset>("BASIC");
        var event3 = new PopupEvents.OpenPopupEvent(popup);

        PopupButton.onClick.AddListener(delegate
        {
            EventSystem.instance.Dispatch(event3);
        });
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        var test = (GameModel)ApplicationFacade.instance.GetModel <GameModel>();

        testButtonText.text = test.MainViewText;

        var event1 = new NavigationEvents.LoadContextEvent(new OtherContext(), true);

        testButton.onClick.AddListener(delegate {
            EventSystem.instance.Dispatch(event1);
        });

        var event2 = new NavigationEvents.PreviousContextEvent();

        backButton.onClick.AddListener(delegate
        {
            EventSystem.instance.Dispatch(event2);
        });
    }
Пример #3
0
    void Awake()
    {
        CardPreview.gameObject.SetActive(false);

        GenerateGridButton.onClick.AddListener(delegate
        {
            var gridEvent = new GridEvents.CreateDataEvent();
            EventSystem.instance.Dispatch(gridEvent);
        });

        PlaceHeroButton.onClick.AddListener(delegate
        {
            var heroEvent = new UnitEvents.PlaceHeroEvent();
            EventSystem.instance.Dispatch(heroEvent);
        });

        PlaceUnitButton.onClick.AddListener(delegate
        {
            var unitEvent = new UnitEvents.PlaceUnitEvent();
            EventSystem.instance.Dispatch(unitEvent);
        });

        ResetMovementButton.onClick.AddListener(delegate
        {
            var movementEvent = new DebugEvents.ResetAllRemainingMovementEvent();
            EventSystem.instance.Dispatch(movementEvent);
        });

        var previousContext = new NavigationEvents.PreviousContextEvent();

        BackButton.onClick.AddListener(delegate
        {
            EventSystem.instance.Dispatch(previousContext);
        });

        _model = ApplicationFacade.instance.GetModel <GridModel>();

        EventSystem.instance.Connect <UnitEvents.UnitSelectedEvent>(OnUnitSelected);
        EventSystem.instance.Connect <CardEvents.CardPreviewEvent>(OnCardPreviewed);
        EventSystem.instance.Connect <CardEvents.HideCardPreviewEvent>(OnHideCardPreview);
    }
 public void OnLoadPreviousContext(NavigationEvents.PreviousContextEvent e)
 {
     LoadPreviousContext();
 }