Exemple #1
0
    void OnChangeColorPicker(IFayvitUiEvent e)
    {
        Material            material = null;
        GameObject          G;
        SimpleChangebleMesh scm;
        Color c = (Color)e.MySendObjects[0];

        switch (cAtual)
        {
        case ContadorAtual.globoOcular:

            int cont = guardCont[ContadorAtual.globoOcular];

            MaskedTexture[] m = S.GetMaskedTexDbWithId(SectionDataBase.globoOcular);

            material = mesh.material;
            material.SetColor(m[cont].coresEditaveis[0].materialColorTarget.ToString(), c);
            umaCor = c;
            //m[cont].coresEditaveis[0].color = c;
            break;

        case ContadorAtual.cabelo:


            GetSimpleChangebleElements(cAtual, out scm, out G);
            material = GetMaterialForChangeColor(G, scm.coresEditaveis[0]);

            material.SetColor(scm.coresEditaveis[0].materialColorTarget.ToString(), c);
            umaCor = c;
            break;

        case ContadorAtual.nariz:
        case ContadorAtual.queixo:
            GetSimpleChangebleElements(cAtual, out scm, out G);
            material = GetMaterialForChangeColor(G, scm.coresEditaveis[0]);

            material.SetColor(scm.coresEditaveis[0].ColorTargetName, c);
            skinColor = c;
            if (scm.coresEditaveis[0].registro == RegistroDeCores.skin)
            {
                ChangeSkinColor();
            }
            break;
        }
    }
        public static void Publish(UIEventKey key, IFayvitUiEvent umEvento = null)
        {
            List <Action <IFayvitUiEvent> > callbackList;

            if (_eventDictionary.TryGetValue(key, out callbackList))
            {
                //Debug.Log(callbackList.Count+" : "+umEvento.Sender+" : "+key);

                foreach (var e in callbackList)
                {
                    if (e != null)
                    {
                        e(umEvento);
                    }
                    else
                    {
                        Debug.LogWarning("Event agregator chamou uma função nula na key: " + key +
                                         "\r\n Geralmente ocorre quando o objeto do evento foi destruido sem se retirar do listener");
                    }
                }
            }
        }
 public static void Publish(IFayvitUiEvent e)
 {
     Publish(e.Key, e);
 }