예제 #1
0
    private void OnClickGet(GameObject go)
    {
        if (MainTaskManager.Instance.ClickLock)
        {
            return;
        }
        BaseTask task = MainTaskManager.Instance.GetTask(TaskDescUI.OpenByTaskId, true);

        if (task != null)
        {
            switch (task.Task.status)
            {
            case Package.Task.TaskStatus.TaskCanAccept:
                task.Accept();
                this.Show(false);
                break;

            case Package.Task.TaskStatus.TaskReceived:
                task.Execute(false, false);
                this.Show(false);
                break;

            case Package.Task.TaskStatus.WaitingToClaimPrize:
                if (TaskDescUI.OpenByNpc > 0 || task.Data.quickComplete == 1)
                {
                    bool isUseDiamond = go.Equals(this.mBtnGetMultiple.get_gameObject());
                    if (GodWeaponProgressManager.Instance.NeedPlayCommitEffect(task, new Action <BaseTask, bool>(this.CommitTask), isUseDiamond))
                    {
                        MainTaskManager.Instance.ClickLock = true;
                    }
                    else
                    {
                        this.CommitTask(task, isUseDiamond);
                    }
                }
                else
                {
                    task.Execute(false, false);
                    this.Show(false);
                }
                break;
            }
        }
    }