Пример #1
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject go   = null;
            GameObject root = GameObject.Find("UIRoot");
            go            = root.transform.Find("TabWindow").gameObject;
            this.mediator = RegisterMediator <TableMediator>(go);
            this.SendToMediator(notice);
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_Reactive:
            GameObject rego = null;     // must use a sync func to load the rego
            root          = GameObject.Find("UIRoot");
            rego          = root.transform.Find("TabWindow").gameObject;
            this.mediator = RegisterMediator <TableMediator>(rego);
            this.SendToMediator(notice);
            break;
        }
        base.Execute(notice);
    }
Пример #2
0
    protected override void OnInitialize()
    {
        that = this;

        buttonList.Add(this.transform.Find("Image/Button1").GetComponent <Button>());
        buttonList.Add(this.transform.Find("Image/Button2").GetComponent <Button>());
        buttonList.Add(this.transform.Find("Image/Button3").GetComponent <Button>());

        mediatorList.Add(AttachSubMediator <SubPageMediator>(this.transform.Find("Image1").gameObject));
        mediatorList.Add(AttachSubMediator <SubPageMediator>(this.transform.Find("Image2").gameObject));
        mediatorList.Add(AttachSubMediator <SubPageMediator>(this.transform.Find("Image3").gameObject));

        base.OnInitialize();
    }
Пример #3
0
 protected override void OnDispose()
 {
     SaveViewObj();
     that = null;
     base.OnDispose();
 }