using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class HumanInductionTaskCell : CellView
|
{
|
[SerializeField] Transform m_Container;
|
[SerializeField] Button m_Induction;
|
|
int taskId = 0;
|
|
TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
|
|
private void Awake()
|
{
|
m_Induction.SetListener(OnInduction);
|
}
|
|
public void Display(int taskId)
|
{
|
this.taskId = taskId;
|
|
m_Container.SetActive(true);
|
model.onInductionTaskComplete -= OnInductionTaskComplete;
|
model.onInductionTaskComplete += OnInductionTaskComplete;
|
}
|
|
private void OnInductionTaskComplete(int obj)
|
{
|
Hide();
|
model.onInductionTaskComplete -= OnInductionTaskComplete;
|
}
|
|
void Hide()
|
{
|
m_Container.SetActive(false);
|
}
|
|
private void OnInduction()
|
{
|
if (taskModel.GetTaskStatus(taskId) == TaskModel.TaskStatus.CardLevel)
|
{
|
SysNotifyMgr.Instance.ShowTip("TaskInductionError_2");
|
return;
|
}
|
|
var pak = new CA512_tagCMThinkMagicWeapon();
|
pak.MWID = (uint)model.selectedTreasure;
|
GameNetSystem.Instance.SendInfo(pak);
|
}
|
}
|
}
|
|