Exemplo n.º 1
0
    private void Awake()
    {
        InputGO    = transform.Find("Input").gameObject;
        InputComp  = InputGO.GetComponent <InputField>();
        InputImage = InputGO.GetComponent <Image>();
        InputValue = InputGO.transform.Find("Value").GetComponent <Text>();

        EditButton      = transform.Find("Edit").gameObject;
        ConfirmButton   = transform.Find("Confirm").gameObject;
        EditCanGroup    = EditButton.GetComponent <CanvasGroup>();
        ConfirmCanGroup = ConfirmButton.GetComponent <CanvasGroup>();

        SetButtonEvents();
        DefaultMode();
    }
Exemplo n.º 2
0
    private void SetButtonEvents()
    {
        EditButton.GetComponent <Button>().onClick.AddListener(() =>
        {
            EditMode(true);
        });

        ConfirmButton.GetComponent <Button>().onClick.AddListener(() =>
        {
            EditMode(false);
            //aarb
            int pos = int.Parse(gameObject.name.Substring(gameObject.name.Length - 1));
            print(pos);
            //agregar nombre en el diccionario
            GameObject.Find("Code").GetComponent <SociedadesController>().SociedadDict[pos].SetName(InputValue.text);
            //aarb
        });
    }