Example #1
0
    public void StartHud(
        SectionCustomizationManager secManager,
        System.Action <int> mainAction,
        System.Action <int, int> changeAction,
        System.Action <int> returnAction,
        CustomizationManagerMenu.EditableElements[] dasOpcoes,
        ResizeUiType tipoDeR = ResizeUiType.vertical,
        int selectIndex      = 0
        )
    {
        this.secManager = secManager;
        this.opcoes     = dasOpcoes;

        this.returnAction += returnAction;
        this.changeAction += changeAction;

        this.MainAction += (int x) =>
        {
            if (!estadoDeAcao)
            {
                estadoDeAcao = true;
                ChangeSelectionTo(x);


                SupportSingleton.Instance.InvokeInRealTime(() =>
                {
                    Debug.Log("Função chamada com delay para destaque do botão");
                    mainAction(x);
                    estadoDeAcao = false;
                }, .05f);
            }
        };
        StartHud(opcoes.Length, tipoDeR, selectIndex);
    }
Example #2
0
    public void StartCombiner(CustomizationContainerDates ccd, string checkKey = "")
    {
        if (ccd.PersBase == PersonagemBase.feminino)
        {
            myBase = myMBase;
        }
        else
        {
            myBase = myHBase;
        }

        target = MonoBehaviour.Instantiate(myBase, myBase.transform.position, myBase.transform.rotation);
        target.gameObject.SetActive(true);

        SupportSingleton.Instance.InvokeOnEndFrame(() =>
        {
            target.SetCustomDates(ccd);

            SupportSingleton.Instance.InvokeOnEndFrame(() =>
            {
                Transform T = CombinerReallyStart();


                MessageAgregator <MsgCombinationComplete> .Publish(new MsgCombinationComplete()
                {
                    combined = T,
                    checkKey = checkKey
                });
            });
        });
    }
    public virtual void SetOptions(
        Action <int> mainAction,
        Action <int> returnAction,
        Action <int, int> horizontalChange,
        CustomizationManagerMenu.EditableElements opcao,
        SectionCustomizationManager scm
        )
    {
        this.scm               = scm;
        ThisAction            += mainAction;
        this.horizontalChange += horizontalChange;
        this.returnAction     += returnAction;
        txtDaOpcao.text        = opcao.displayName;

        switch (opcao.type)
        {
        case CustomizationManagerMenu.EditableType.color:
            SupportSingleton.Instance.InvokeOnEndFrame(() =>
            {
                viewColorImg.transform.parent.gameObject.SetActive(true);

                Color C            = scm.GetColorOfMember(opcao.member, opcao.inIndex);
                C.a                = 1;
                viewColorImg.color = C;
            });
            break;

        case CustomizationManagerMenu.EditableType.mesh:
        case CustomizationManagerMenu.EditableType.texture:
            controlButtonsContainer.SetActive(true);
            break;
        }
    }
Example #4
0
 public void SetDates(
     TesteMeshCombiner meshCombiner,
     SectionCustomizationManager secManager)
 {
     this.meshCombiner = meshCombiner;
     this.secManager   = secManager;
 }
Example #5
0
    public static void InitProvisionalStartGame(
        TesteMeshCombiner meshCombiner,
        SectionCustomizationManager secManager)
    {
        GameObject           G = new GameObject();
        ProvisionalStartGame P = G.AddComponent <ProvisionalStartGame>();

        P.SetDates(meshCombiner, secManager);
        P.Init();
    }
Example #6
0
    void ChangeBaseCharacter(bool masculino)
    {
        if (masculino)
        {
            secManager = secManagerH_Base;
            sdbc       = sdbc_H;
        }
        else
        {
            secManager = secManagerM_Base;
            sdbc       = sdbc_M;
        }

        secManagerH_Base.gameObject.SetActive(masculino);
        secManagerM_Base.gameObject.SetActive(!masculino);
    }
Example #7
0
    public void StartCombiner(SectionCustomizationManager source, string checkKey = "")
    {
        //if (!source.masculino)
        //    myBase = myMBase;
        //else
        //    myBase = myHBase;

        triangles.Clear();
        uvs.Clear();
        materials.Clear();
        boneWeights.Clear();
        normals.Clear();
        vertices.Clear();
        weldVertices.Clear();
        vertCount = 0;

        CustomizationContainerDates ccd = source.GetCustomDates();

        StartCombiner(ccd, checkKey);
    }
Example #8
0
    // Use this for initialization
    void Start()
    {
        SupportSingleton.Instance.InvokeOnEndFrame(() =>
        {
            MessageAgregator <MsgStartMusic> .Publish(new MsgStartMusic()
            {
                clip = menuMusic
            });
        });

        //menusAtivos &= ~FlagSectionDataBase.pupila;

        if (secManager is null)
        {
            secManager = FindObjectOfType <SectionCustomizationManager>();
        }

        if (sdbc is null)
        {
            sdbc = FindObjectOfType <SectionDataBaseContainer>();
        }

        //string[] StartOptions = GetActiveOption(ActiveEditables);
        activeEditables = ActiveEditables;
        cMenu.StartHud(secManager, MainAction, ChangeAction, EscapeAction, activeEditables);

        SupportSingleton.Instance.InvokeOnEndFrame(() =>// acontecia do evento ser publicado antes da camera estar pronta
        {
            MessageAgregator <MsgChangeMenuDb> .Publish(new MsgChangeMenuDb()
            {
                sdb = activeEditables[0].mySDB
            });
        });

        MessageAgregator <MsgChangeOptionUI> .AddListener(OnUiChange);

        MessageAgregator <MsgSelectedColorByClick> .AddListener(OnSelectColorByClick);

        MessageAgregator <MsgFinishEdition> .AddListener(OnFinishEdition);
    }