示例#1
0
 public override void EnterTask()
 {
     data = GameData <DataGuideTaskInfo> .dataMap[this.TaskId];
     EventDispatch.AddListener <GameObject>(Events.DlgAddGuideEvent, this.OnUIOpenAddButtonEvent);
     //添加事件
     this.ShowGuide();
 }
示例#2
0
    public override void FinishTask()
    {
        this.EventButton.transform.SetParent(this.EventButtonTempParent);
        if (this.ShowView != null)
        {
            this.ShowView.transform.SetParent(this.EventButtonTempParent);
        }
        this.EventButtonTempParent = null;

        if (data.BtnTriggerType == (int)EButtonTriggerType.Click)
        {
            Selectable eventBtn = this.EventButton.GetComponent <Selectable>();
            if (eventBtn != null)
            {
                if (eventBtn is Button)
                {
                    (eventBtn as Button).onClick.RemoveListener(this.OnClick);
                }
                else
                {
                    (eventBtn as Toggle).onValueChanged.RemoveListener(this.OnSelect);
                }
            }
            else
            {
                if (controller != null)
                {
                    controller.onClickDown -= this.OnClick;
                    controller.onClickUp   -= this.OnClickUp;
                    controller.onClickDown  = null;
                    controller.onClickUp    = null;
#if UNITY_ANDROID
                    VoiceManager.Instance.StartSpeech();
#elif UNITY_IOS
                    VoiceManager.Instance.StartSpeech_IOS();
#endif
                    EventDispatch.Broadcast <bool>(Events.DlgTextShowMask, true);
                }
            }
        }
        this.controller = null;
        this.data       = null;
        this.ShowView   = null;
        base.FinishTask();
    }