Exemple #1
0
        /// <summary>
        /// Constructor para instanciar un nuevo ícono de nota, asignando sus respectivas variables.
        /// </summary>
        /// <param name="group">La nota de referencia.</param>
        /// <param name="index">El índice de la nota en el array de SongManagerNoteInput.</param>
        /// <param name="owner">La UI dueña.</param>
        public GroupIconInstances(NoteGroup group, NotesUI owner, Action <GroupIconInstances> onRemove, bool nextGroup = false)
        {
            this.group         = group;
            this.owner         = owner;
            this.longNote      = group.IsLongNote;
            this.durationScale = group.GetDuration * Subdivision.subtepSize / owner.beatRange;

            // Tomar el indicador de notas respectivo y asignarle el mismo color al ícono de nota
            noteIcons = new NoteIcon[SongManagerNoteInput.GetMaxInputs];
            for (int i = 0; i < noteIcons.Length; i++)
            {
                if (group.GetNote(i))
                {
                    NoteIndicator indicator = owner.noteIndicators[i];
                    noteIcons[i] = Instantiate(owner.noteIconPrefab, indicator.GetTransform);
                    noteIcons[i].Initialize(indicator, durationScale, i, DestroyIcon);
                    if (nextGroup)
                    {
                        noteIcons[i].OnNextNote();
                    }

                    noteCount++;
                }
            }

            group.onNoteEvent += OnIconEvent;
            Remove             = () => onRemove(this);
        }
Exemple #2
0
        public void Initialize(NotesUI owner, RectTransform rectParent, QuadraticCurve curve, int input)
        {
            if (indicatorUI == null)
            {
                indicatorUI = Instantiate(owner.noteIndicatorPrefab, rectParent);
            }

            // Colocamos el indicador segun nos indique la curva
            float scale = rectParent.rect.height * 2;

            indicatorUI.Initialize(curve.FromPoint * scale, this.color, input);

            // Hacemos que la curva empiece desde el punto 0 para que sea relativo al indicador
            // y tratamos de conseguir un camino para las notas
            curve.FromPoint = Vector2.zero;
            curvePath.UpdateCurve(curve, curveSpacing, curveResolution, scale);
        }
Exemple #3
0
 public void LoadNotify(int p, Button caller)
 {
     if (lu == null)
     {
         lu = GameObject.Instantiate(LoadProfile, transform.root, false).GetComponent <LoadUI>();
     }
     if (nu == null)
     {
         nu = GameObject.Instantiate(NoteEditor, transform.root, false).GetComponent <NotesUI>();
     }
     else
     {
         nu.transform.SetAsLastSibling();
     }
     lu.TurnOn(p, this, nu, caller);
     transform.root.GetChild(0).GetComponent <CanvasGroup>().interactable = false;
 }
Exemple #4
0
    public void SaveNotify()
    {
        int n = getNext();

        if (pu == null)
        {
            pu = GameObject.Instantiate(NewProfile, transform.root, false).GetComponent <portraitUI>();
        }
        if (nu == null)
        {
            nu = GameObject.Instantiate(NoteEditor, transform.root, false).GetComponent <NotesUI>();
        }
        else
        {
            nu.transform.SetAsLastSibling();
        }
        pu.TurnOn(this, nu, n);
        transform.root.GetChild(0).GetComponent <CanvasGroup>().interactable = false;
    }
Exemple #5
0
    IEnumerator LevelStartupSequence()
    {
        GameObject instructions = GameObject.FindGameObjectWithTag("Instructions");

        while (fadeImage && fadeImage.color.a > .005)
        {
            fadeImage.color = new Color(fadeImage.color.r, fadeImage.color.b, fadeImage.color.g, fadeImage.color.a - .0075f);
            yield return(null);
        }

        if (!instructions)
        {
            Debug.LogError("Something's wrong, we can't find the instructions UI");
        }
        else
        {
            NotesUI notesUI = instructions.GetComponent <NotesUI>();
            if (notesUI)
            {
                notesUI.OpenNoteCard();
            }
        }
    }
Exemple #6
0
 protected override void OnInitialize(NeepEffect owner)
 {
     ui = owner.Manager.UI;
 }
Exemple #7
0
    public void TurnOn(int p, SaveManager sm, NotesUI notesU, Button caller)
    {
        profile = -1;
        string updateTXT, lTXT, cancelTXT;

        nU = notesU;
        switch (PlayerPrefs.GetInt("Lang"))
        {
        // "cancel",
        // "delete",
        // "load",

        case 1:
            updateTXT = "更新";
            lTXT      = "打开";
            cancelTXT = "取消";
            //chinese
            break;

        case 2:
            updateTXT = "更新";
            lTXT      = "開く";
            cancelTXT = "中止";
            //ja
            break;

        case 3:
            updateTXT = "Обновить";
            lTXT      = "Загрузить файл";
            cancelTXT = "Отмена";
            //rus
            break;

        case 4:
            updateTXT = "actualizar";
            lTXT      = "cargar";
            cancelTXT = "cancelar";
            //spanish
            break;

        case 5:
            updateTXT = "ปรับปรุง";
            lTXT      = "โหลด";
            cancelTXT = "ยกเลิก";
            //thai
            break;

        case 6:
            updateTXT = "réactualiser";
            lTXT      = "charge";
            cancelTXT = "Annuler";
            //french
            break;

        default:
            updateTXT = "update";
            lTXT      = "Load";
            cancelTXT = "Cancel";
            //english
            break;
        }


        Button load, update, delete, notesOk;

        load    = transform.GetChild(0).GetComponent <Button>();
        update  = transform.GetChild(1).GetComponent <Button>();
        delete  = transform.GetChild(2).GetComponent <Button>();
        notesOk = nU.transform.GetChild(0).GetComponent <Button>();


        TMP_InputField name = transform.GetChild(4).GetComponent <TMP_InputField>();

        transform.GetChild(3).GetChild(0).GetComponent <TextMeshProUGUI>().text = PlayerPrefs.GetString(p + "NOTES");
        name.text = PlayerPrefs.GetString("SAVE" + p);

        if (cancelTXT != "Cancel")
        {
            load.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text   = lTXT;
            update.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = updateTXT;
            transform.GetChild(transform.childCount - 1).GetChild(0).GetComponent <TextMeshProUGUI>().text = cancelTXT;
        }
        setButtonColors(load, update);
        //listeners stuff
        removeAllListeners(load, update, delete, name, notesOk);
        load.onClick.AddListener(() =>
        {
            sm.Load(p);
        }
                                 );


        update.onClick.AddListener(() =>
        {
            Debug.Log("update " + p);
            sm.DeleteSubstance(p);
            sm.Save(null, p, 1);
        }
                                   );


        delete.onClick.AddListener(() =>
        {
            sm.Delete(p);
            Destroy(caller.gameObject);
        });

        notesOk.onClick.AddListener(() =>
        {
            transform.GetChild(3).GetChild(0).GetComponent <TextMeshProUGUI>().text = nU.transform.GetChild(nU.transform.childCount - 1).GetComponent <TMP_InputField>().text;
        });



        name.onEndEdit.AddListener((string val) =>
        {
            caller.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = val;
        });



        CanvasGroup cg = GetComponent <CanvasGroup>();

        profile           = p;
        cg.interactable   = true;
        cg.blocksRaycasts = true;

        LeanTween.value(Camera.main.gameObject, (float val) =>
        {
            cg.alpha = val;
        }, 0, 1, 0.2f).setEase(LeanTweenType.easeOutCubic).setOnComplete(() =>
        {
        });
    }
Exemple #8
0
    public void TurnOn(SaveManager sm, NotesUI nu, int p)
    {
        string SPT, OK, cTXT, name, AddNotes;

        switch (PlayerPrefs.GetInt("Lang"))
        {
        case 1:
            SPT      = "保存人像为:";
            OK       = "确定";
            cTXT     = "取消";
            name     = "名称?";
            AddNotes = "添加注释";
            //chinese
            break;

        case 2:
            SPT      = "名前を付けて保存:";
            OK       = "はい";
            cTXT     = "中止";
            name     = "名?";
            AddNotes = "ノート";
            //ja
            break;

        case 3:
            SPT      = "сохранить как:";
            OK       = "ОК";
            cTXT     = "Отмена";
            name     = "имя?";
            AddNotes = "заметки";
            //rus
            break;

        case 4:
            SPT      = "guardar retrato como:";
            OK       = "ok";
            cTXT     = "cancelar";
            name     = "¿nombre?";
            AddNotes = "agregar notas";
            break;

        case 5:
            SPT      = "บันทึกภาพเป็น:";
            OK       = "ตกลง";
            cTXT     = "ยกเลิก";
            name     = "ชื่อ?";
            AddNotes = "เพิ่มบันทึก";
            //thai
            break;

        case 6:
            SPT      = "enregistrer le portrait sous:";
            OK       = "bien";
            cTXT     = "Annuler";
            name     = "prénom?";
            AddNotes = "ajouter notes";
            //french
            break;

        default:
            SPT      = "save portrait as:";
            OK       = "Ok";
            cTXT     = "Cancel";
            name     = "name?";
            AddNotes = "add notes";

            //english
            break;
        }

        Button ok, addnotes;

        ok       = transform.GetChild(0).GetComponent <Button>();
        addnotes = transform.GetChild(1).GetComponent <Button>();

        if (AddNotes != "add notes")
        {
            ok.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text       = OK;
            addnotes.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = AddNotes;
            transform.GetChild(2).GetComponent <TextMeshProUGUI>().text          = SPT;
            transform.GetChild(transform.childCount - 1).GetChild(0).GetComponent <TextMeshProUGUI>().text = cTXT;
        }

        TMP_InputField t = transform.GetChild(3).GetComponent <TMP_InputField>();

        setButtonColors(ok, addnotes);
        //listeners stuff
        removeAllListeners(ok, addnotes);


        ok.onClick.AddListener(() =>
        {
            if (!string.IsNullOrEmpty(t.text))
            {
                sm.Save(t, p);
                TurnOff();
            }
            else
            {
                t.text = name;
            }
        }
                               );


        addnotes.onClick.AddListener(() =>
        {
            nu.TurnOn(p);
        });

        CanvasGroup cg = GetComponent <CanvasGroup>();

        cg.interactable   = true;
        cg.blocksRaycasts = true;

        LeanTween.value(Camera.main.gameObject, (float val) =>
        {
            cg.alpha = val;
        }, 0, 1, 0.2f).setEase(LeanTweenType.easeOutCubic).setOnComplete(() =>
        {
        });
    }