-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class CameraBehaviour : MonoBehaviour { | ||
private const int Z_MINIMO = 10; | ||
private const int Z_MAXIMO = 200; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
int speed = 0; | ||
|
||
if (Input.GetKey(KeyCode.UpArrow) && transform.position.z > Z_MINIMO) | ||
{ | ||
speed = 1; | ||
} | ||
else if (Input.GetKey(KeyCode.DownArrow) && transform.position.z < Z_MAXIMO) | ||
{ | ||
speed = -1; | ||
} | ||
|
||
transform.Translate(Vector3.forward * speed); | ||
Debug.Log(transform.localPosition); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 6 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_Name: Contenedor | ||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} | ||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: 3000 | ||
stringTagMap: | ||
RenderType: Transparent | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Floats: | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 10 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _Metallic: 0 | ||
- _Mode: 3 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 0 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _ZWrite: 0 | ||
m_Colors: | ||
- _Color: {r: 1, g: 1, b: 1, a: 0.3019608} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 6 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_Name: Gas | ||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} | ||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A | ||
m_LightmapFlags: 2 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: 3000 | ||
stringTagMap: | ||
RenderType: Transparent | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Floats: | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 10 | ||
- _GlossMapScale: 0 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _InvFade: 1 | ||
- _Metallic: 0 | ||
- _Mode: 3 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 1 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _ZWrite: 0 | ||
m_Colors: | ||
- _Color: {r: 0.9265502, g: 0.9433962, b: 0.09344962, a: 0.3019608} | ||
- _EmissionColor: {r: 0.4481561, g: 0.5660378, b: 0.056069776, a: 1} | ||
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class GasBehaviour : MonoBehaviour { | ||
private const float CONSTANTE_GASES = 0.082f; | ||
public float presion; | ||
public float volumen; | ||
public float temperatura; | ||
public float moles; | ||
public bool presionFija = false; | ||
public bool volumenFijo = false; | ||
public bool temperaturaFija = false; | ||
public bool molesFijo = false; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void CambiarPresion(float presion) | ||
{ | ||
this.presion = presion; | ||
ActualizarVolumen(); | ||
ActualizarTemperatura(); | ||
ActualizarMoles(); | ||
} | ||
|
||
public void CambiarVolumen(float volumen) | ||
{ | ||
this.volumen = volumen; | ||
ActualizarPresion(); | ||
ActualizarTemperatura(); | ||
ActualizarMoles(); | ||
} | ||
|
||
public void CambiarMoles(float moles) | ||
{ | ||
this.moles = moles; | ||
ActualizarPresion(); | ||
ActualizarVolumen(); | ||
ActualizarTemperatura(); | ||
ActualizarParticleSystem(); | ||
} | ||
|
||
public void CambiarTemperatura(float temperatura) | ||
{ | ||
this.temperatura = temperatura; | ||
ActualizarPresion(); | ||
ActualizarVolumen(); | ||
ActualizarMoles(); | ||
} | ||
|
||
private void ActualizarPresion() | ||
{ | ||
if (!presionFija) | ||
{ | ||
presion = moles * CONSTANTE_GASES * temperatura / volumen; | ||
} | ||
} | ||
|
||
private void ActualizarMoles() | ||
{ | ||
if (!molesFijo) | ||
{ | ||
moles = Convert.ToSingle(presion * volumen / (CONSTANTE_GASES * temperatura)); | ||
ActualizarParticleSystem(); | ||
} | ||
} | ||
|
||
private void ActualizarTemperatura() | ||
{ | ||
if (!temperaturaFija) | ||
{ | ||
temperatura = presion * volumen / (moles * CONSTANTE_GASES); | ||
} | ||
} | ||
|
||
private void ActualizarVolumen() | ||
{ | ||
if (!volumenFijo) | ||
{ | ||
volumen = moles * CONSTANTE_GASES * temperatura / presion; | ||
GameObject.Find("VolumenInput").GetComponent<VolumenInputBehaviour>().ActualizarContenedor(volumen); | ||
} | ||
} | ||
|
||
private void ActualizarParticleSystem() | ||
{ | ||
ParticleSystem particleSystem = gameObject.GetComponent<ParticleSystem>(); | ||
ParticleSystem.Burst[] nuevoBurst = new ParticleSystem.Burst[particleSystem.emission.burstCount]; | ||
particleSystem.emission.GetBursts(nuevoBurst); | ||
nuevoBurst[0].count = 30 * moles; | ||
particleSystem.emission.SetBursts(nuevoBurst); | ||
particleSystem.Stop(false, ParticleSystemStopBehavior.StopEmittingAndClear); | ||
particleSystem.Play(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class GestorDeTogglesBehaviour : MonoBehaviour { | ||
private const int CANTIDAD_DE_PROPIEDADES_FIJAS_MAXIMA = 2; | ||
private int cantidadDePropiedadesFijas = 0; | ||
private bool seDebenFijarPropiedades = true; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void FijarPropiedad(GameObject toggle) | ||
{ | ||
if (seDebenFijarPropiedades) | ||
{ | ||
Toggle toggleBehaviour = toggle.GetComponent<Toggle>(); | ||
|
||
if (toggleBehaviour != null) | ||
{ | ||
cantidadDePropiedadesFijas += toggleBehaviour.isOn ? -1 : 1; | ||
|
||
if (cantidadDePropiedadesFijas > CANTIDAD_DE_PROPIEDADES_FIJAS_MAXIMA) | ||
{ | ||
cantidadDePropiedadesFijas = CANTIDAD_DE_PROPIEDADES_FIJAS_MAXIMA; | ||
seDebenFijarPropiedades = false; | ||
toggleBehaviour.isOn = true; | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
seDebenFijarPropiedades = true; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.