Exemple #1
0
    public void OnInit(DatabaseManager.CursoData data, bool forceActive)
    {
        this.data = data;
        //field.text = data.id + " - Score: " + data.test_score;
        DatabaseManager.CursoData cursoData = Data.Instance.databaseManager.GetCursoByID(data.id);
        field.text = cursoData.nombre;

        bool isReady = Data.Instance.userData.IsCursoDone(data.id);

        if (isReady)
        {
            GetComponent <StarsManager>().Init(cursoData.test_score);
        }
        else
        {
            GetComponent <StarsManager>().Hide();
        }

        if (forceActive)
        {
            isReady = true;
        }

        locked.SetActive(!isReady);

        if (!isReady)
        {
            GetComponent <Button>().interactable = false;
        }
    }
Exemple #2
0
    public void OnInit(DatabaseManager.CursoData data, bool forceUnBlock)
    {
        this.data  = data;
        field.text = data.nombre;
        bool isLocked = Data.Instance.databaseManager.IsCursoLocked(data.id);

        if (forceUnBlock)
        {
            isLocked = false;
        }



        locked.SetActive(isLocked);
        if (isLocked)
        {
            GetComponent <Button>().interactable = false;
        }
        image.sprite = characters[data.character_id];
        if (Data.Instance.userData.IsCursoDone(data.id))
        {
            doneGameObject.SetActive(true);
        }
        else
        {
            doneGameObject.SetActive(false);
        }
    }
Exemple #3
0
 void SetCursoByID(int curso_id)
 {
     Data.Instance.userData.curso_active_id = curso_id;
     all         = Data.Instance.databaseManager.GetAllTestDataByCurso(curso_id);
     actualCurso = Data.Instance.databaseManager.GetCursoByID(curso_id);
     print("actualCurso " + actualCurso.id + " score: " + actualCurso.test_score);
 }
Exemple #4
0
    public override void OnUIButtonClicked(UIButton uiButton)
    {
        UICursoButton button = (UICursoButton)uiButton;

        this.data = button.data;
        Data.Instance.userData.curso_active_id = button.data.id;
        characters[button.data.character_id].SetActive(true);
        GetComponent <CursoContentUI>().Init(CursoContentUI.types.CURSO);
        Close();
    }