Exemple #1
0
    public override void Awake(GameObject go)
    {
        base.Awake(go);

        t          = transform.Find("Scroll View/Viewport/Content");
        taskPrefab = Resources.Load <GameObject>("Task/Task");
        acceptBtn  = transform.Find("AcceptTask").GetComponent <Button>();
        attk1Btn   = transform.Find("AtkItem1").GetComponent <Button>();
        attk2Btn   = transform.Find("AtkItem2").GetComponent <Button>();
        putBtn     = transform.Find("Put").GetComponent <Button>();

        if (Save.CurrtasksList.Count > 0)
        {
            ShowTask();
        }
        acceptBtn.onClick.AddListener(() => {
            AllTask();
            acceptBtn.interactable = false;
            Task task = Save.AlltasksList.Find(x => x.Name == "Kill");
            Save.AcceptTask(task);
            ShowTask();
        });

        attk1Btn.onClick.AddListener(() => {
            Task task = Save.CurrtasksList.Find(x => x.Name == "Kill");
            Save.MakeTask(task);
            ShowTask();
        });
    }