Ejemplo n.º 1
0
    private void MainAction(int index)
    {
        EditableElements target = activeEditables[index];

        if (target.type == EditableType.control)
        {
            ControlMainAction(target);
        }
        else if (target.type == EditableType.mesh || target.type == EditableType.texture)
        {
            ChangeElementMainAction(target);
        }
        else if (target.type == EditableType.color)
        {
            ColorContainerStruct ccs = secManager.GetColorAssignById(target.member).coresEditaveis[target.inIndex];

            secManager.StartChangeColor(target.member, target.inIndex, ccs);
            ChangeColorMainAction(ccs);
            estado = EstadoDoMenu.colorGrid;
        }
        else if (target.type == EditableType.personagemBase)
        {
            if (secManager == secManagerH_Base)
            {
                ChangeBaseCharacter(false);
                DirectionalCamera cDir = CameraApplicator.cam.Cdir;
                //CameraAplicator.cam.FocusBasicCam(secManager.transform, 0.2f, .7f);
                CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                SupportSingleton.Instance.InvokeOnEndFrame(() =>
                {
                    secManager.SetColorsByAssign(secManagerH_Base.ColorAssign);
                });
            }
            else if (secManager == secManagerM_Base)
            {
                ChangeBaseCharacter(true);
                DirectionalCamera cDir = CameraApplicator.cam.Cdir;
                //CameraAplicator.cam.FocusBasicCam(secManager.transform, 0.2f, .7f);
                CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                SupportSingleton.Instance.InvokeOnEndFrame(() =>
                {
                    CameraApplicator.cam.Cdir.VarVerticalHeightPoint = .7f;
                    secManager.SetColorsByAssign(secManagerM_Base.ColorAssign);
                });
            }
        }
        else if (target.type == EditableType.conclusao)
        {
            estado = EstadoDoMenu.confirmacaoAberta;
            confirmation.StartConfirmationPanel(
                () => {
                cMenu.FinishHud();
                ProvisionalStartGame.InitProvisionalStartGame(
                    testMeshCombiner, secManager
                    );
            },
                () => {
                estado = EstadoDoMenu.main;
            },
                "Iniciar o jogo com esse personagem?",
                hideSelections: true
                );
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     confirmation.StartConfirmationPanel(
         () => { Debug.Log("Yes pressed"); },
         () => { Debug.Log("No pressed"); }, "Ola");
 }