Example #1
0
    IEnumerator animacionSalir()
    {
        animatorMenuPpal.SetTrigger("exit");

        yield return(new WaitForSeconds(0.6f));

        StartCoroutine(CameraAnimations.animacionSalirMenuCrear(escena));
        yield return(new WaitForSeconds(2f));

        LevelLoader LevelL = GameObject.FindGameObjectWithTag("LevelLoader").GetComponent <LevelLoader>();

        LevelL.loadLevel(escena);
        // SceneManager.LoadScene(escena, LoadSceneMode.Single);
    }
Example #2
0
    public void nuevaViaLactea()
    {
        //TMP_InputField totalNebulosas=canvasMenuCrear.transform.Find("Canvas/Nebulosas/Total").GetComponent<TMP_InputField>();
        //TMP_InputField totalSistemasPlanetarios=canvasMenuCrear.transform.Find("Canvas/SistemasPlanetarios/Total").GetComponent<TMP_InputField>();
        //TMP_InputField totalSistemasPlanetas= canvasMenuCrear.transform.Find("Canvas/Planetas/Total").GetComponent<TMP_InputField>();

        Slider maxNebulosas           = canvasMenuCrear.transform.Find("Canvas/Nebulosas/Slider").GetComponent <Slider>();
        Slider maxSistemasPlanetarios = canvasMenuCrear.transform.Find("Canvas/SistemasPlanetarios/Slider").GetComponent <Slider>();
        Slider maxPlanetas            = canvasMenuCrear.transform.Find("Canvas/Planetas/Slider").GetComponent <Slider>();

        Toggle         random          = canvasMenuCrear.transform.Find("Canvas/Info/Toggle").GetComponent <Toggle>();
        TMP_InputField nombreViaLactea = canvasMenuCrear.transform.Find("Canvas/Info/Nombre").GetComponent <TMP_InputField>();


        ViaLactea viaLactea = new ViaLactea();

        viaLactea.nombre    = nombreViaLactea.text;
        viaLactea.Nebulosas = new List <Nebulosa>();



        if (random.isOn)
        {
            int nebulosas = Random.Range((int)maxNebulosas.minValue, (int)maxNebulosas.value);
            for (int i = 0; i < nebulosas; i++)
            {
                Nebulosa nebulosaTemp = crearNebulosa();
                viaLactea.Nebulosas.Add(nebulosaTemp);
                int sistemas = Random.Range((int)maxSistemasPlanetarios.minValue, (int)maxSistemasPlanetarios.value);
                for (int j = 0; j < sistemas; j++)
                {
                    SistemaPlanetario sistemaTemp = crearsistemaPlanetario();
                    viaLactea.Nebulosas[i].sistemasPlanetarios.Add(sistemaTemp);
                    for (int k = 0; k < (int)maxPlanetas.value; k++)
                    {
                        Planeta planeta = crearPlaneta();
                        viaLactea.Nebulosas[i].sistemasPlanetarios[j].nodos.Add(planeta);
                    }
                }
            }
        }
        else
        {
            for (int i = 0; i < (int)maxNebulosas.value; i++)
            {
                Nebulosa nebulosa = crearNebulosa();
                viaLactea.Nebulosas.Add(nebulosa);
                for (int j = 0; j < (int)maxSistemasPlanetarios.value; j++)
                {
                    SistemaPlanetario sistema = crearsistemaPlanetario();
                    viaLactea.Nebulosas[i].sistemasPlanetarios.Add(sistema);

                    for (int k = 0; k < (int)maxPlanetas.value; k++)
                    {
                        Planeta planeta = crearPlaneta();
                        viaLactea.Nebulosas[i].sistemasPlanetarios[j].nodos.Add(planeta);
                    }
                }
            }
        }


        viaLactea = ViaLacteaService.PostViaLactea(viaLactea);
        CargarViaLactea cargar = GameObject.FindGameObjectWithTag("ViaLactea").GetComponent <CargarViaLactea>();

        cargar.setViaLactea(viaLactea);

        StartCoroutine(CameraAnimations.animacionSalirMenuCrear("Editor"));

        StartCoroutine(irAEditor());
    }
Example #3
0
    private void DrawWeaponBase()
    {
        EditorGUILayout.Space();
        EditorGUILayout.BeginVertical("Window");

        EditorGUI.BeginChangeCheck();
        int weaponId = EditorGUILayout.IntField("Weapon ID", m_Target.weaponId);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Weapon ID");
            m_Target.weaponId = weaponId;
        }

        EditorGUI.BeginChangeCheck();
        string weaponName = EditorGUILayout.TextField("Weapon Name", m_Target.weaponName);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Weapon Name");
            m_Target.weaponName = weaponName;
        }

        if (m_Target.weaponName.Length > 0)
        {
            m_Target.gameObject.name = m_Target.weaponName;
        }
        else
        {
            m_Target.gameObject.name = "Weapon Name";
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Weapon Icon");

        EditorGUI.BeginChangeCheck();
        Texture2D weaponIcon = (Texture2D)EditorGUILayout.ObjectField(m_Target.weaponIcon, typeof(Texture2D), false);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Weapon Icon");
            m_Target.weaponIcon = weaponIcon;
        }

        EditorGUILayout.EndHorizontal();

        EditorGUI.BeginChangeCheck();
        GameObject droppablePrefab = (GameObject)EditorGUILayout.ObjectField("Droppable Prefab", m_Target.droppablePrefab, typeof(GameObject), false);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Droppable Prefab");
            m_Target.droppablePrefab = droppablePrefab;
        }

        EditorGUILayout.Space();

        EditorGUI.BeginChangeCheck();
        float weight = EditorGUILayout.Slider("Weapon Weight", m_Target.weight, 0, 2.5f);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Weapon Weight");
            m_Target.weight = weight;
        }

        EditorGUI.BeginChangeCheck();
        CrosshairStyle crosshairStyle = (CrosshairStyle)EditorGUILayout.EnumPopup("Crosshair Style", m_Target.crosshairStyle);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Crosshair Style");
            m_Target.crosshairStyle = crosshairStyle;
        }

        EditorGUILayout.Space();

        EditorGUI.BeginChangeCheck();
        bool melee = EditorGUILayout.Toggle("Melee Attack", m_Target.melee);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Disabe/Enable Melee Attack");
            m_Target.melee = melee;
        }

        EditorGUILayout.Space();

        EditorGUI.BeginChangeCheck();
        Camera mainCamera = (Camera)EditorGUILayout.ObjectField("Main Camera", m_Target.mainCamera, typeof(Camera), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Main Camera");
            m_Target.mainCamera = mainCamera;
        }

        EditorGUI.BeginChangeCheck();
        MoveController controller = (MoveController)EditorGUILayout.ObjectField("Player", m_Target.controller, typeof(MoveController), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Player");
            m_Target.controller = controller;
        }

        EditorGUI.BeginChangeCheck();
        CameraAnimations cameraAnimations = (CameraAnimations)EditorGUILayout.ObjectField("Camera Animations", m_Target.cameraAnimations, typeof(CameraAnimations), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed Camera Animations");
            m_Target.cameraAnimations = cameraAnimations;
        }

        EditorGUI.BeginChangeCheck();
        PlayerUI ui = (PlayerUI)EditorGUILayout.ObjectField("UI", m_Target.UI, typeof(PlayerUI), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Changed UI");
            m_Target.UI = ui;
        }

        EditorGUI.BeginChangeCheck();
        BulletMarkManager bulletMark = (BulletMarkManager)EditorGUILayout.ObjectField("Bullet Marks Manager", m_Target.bulletMark, typeof(BulletMarkManager), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Bullet Marks Manager");
            m_Target.bulletMark = bulletMark;
        }

        EditorGUI.BeginChangeCheck();
        WeaponsManager weaponManager = (WeaponsManager)EditorGUILayout.ObjectField("Weapons Manager", m_Target.weaponManager, typeof(WeaponsManager), true);

        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Bullet Weapons Manager");
            m_Target.weaponManager = weaponManager;
        }

        EditorGUILayout.Space();
        if (GUILayout.Button("Enable / Disabe"))
        {
            if (hide)
            {
                hide = false;
            }
            else
            {
                hide = true;
            }
            m_Target.DisableRenders(hide);
        }

        EditorGUILayout.EndVertical();
    }