mirror of
https://github.com/ConjureETS/EscapeTheRoom.git
synced 2026-03-24 01:00:58 +00:00
Input des boutons du joueurs
This commit is contained in:
parent
c5a8b5d9fa
commit
032ce91118
@ -85,139 +85,48 @@ NavMeshSettings:
|
|||||||
cellSize: .166666672
|
cellSize: .166666672
|
||||||
manualCellSize: 0
|
manualCellSize: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
--- !u!1 &504302917
|
--- !u!1001 &273764419
|
||||||
GameObject:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
serializedVersion: 4
|
|
||||||
m_Component:
|
|
||||||
- 4: {fileID: 504302921}
|
|
||||||
- 33: {fileID: 504302920}
|
|
||||||
- 65: {fileID: 504302919}
|
|
||||||
- 23: {fileID: 504302918}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Cube
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!23 &504302918
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 504302917}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
|
||||||
m_SubsetIndices:
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_UseLightProbes: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_PreserveUVs: 1
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_AutoUVMaxDistance: .5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
--- !u!65 &504302919
|
|
||||||
BoxCollider:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 504302917}
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Modification:
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_TransformParent: {fileID: 0}
|
||||||
--- !u!33 &504302920
|
m_Modifications:
|
||||||
MeshFilter:
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_ObjectHideFlags: 0
|
propertyPath: m_LocalPosition.x
|
||||||
m_PrefabParentObject: {fileID: 0}
|
value: 1.30999994
|
||||||
m_PrefabInternal: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_GameObject: {fileID: 504302917}
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
propertyPath: m_LocalPosition.y
|
||||||
--- !u!4 &504302921
|
value: 1.27999997
|
||||||
Transform:
|
objectReference: {fileID: 0}
|
||||||
m_ObjectHideFlags: 0
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_PrefabParentObject: {fileID: 0}
|
propertyPath: m_LocalPosition.z
|
||||||
m_PrefabInternal: {fileID: 0}
|
value: -8.47000027
|
||||||
m_GameObject: {fileID: 504302917}
|
objectReference: {fileID: 0}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_LocalPosition: {x: 0, y: -.860000014, z: -.416000009}
|
propertyPath: m_LocalRotation.x
|
||||||
m_LocalScale: {x: 4.98590565, y: .245846689, z: 4.98590422}
|
value: 0
|
||||||
m_Children: []
|
objectReference: {fileID: 0}
|
||||||
m_Father: {fileID: 0}
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_RootOrder: 2
|
propertyPath: m_LocalRotation.y
|
||||||
--- !u!1 &1726972099
|
value: 0
|
||||||
GameObject:
|
objectReference: {fileID: 0}
|
||||||
m_ObjectHideFlags: 0
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_PrefabParentObject: {fileID: 0}
|
propertyPath: m_LocalRotation.z
|
||||||
m_PrefabInternal: {fileID: 0}
|
value: 0
|
||||||
serializedVersion: 4
|
objectReference: {fileID: 0}
|
||||||
m_Component:
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
- 4: {fileID: 1726972101}
|
propertyPath: m_LocalRotation.w
|
||||||
- 108: {fileID: 1726972100}
|
value: 1
|
||||||
m_Layer: 0
|
objectReference: {fileID: 0}
|
||||||
m_Name: Directional Light
|
- target: {fileID: 464732, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
m_TagString: Untagged
|
propertyPath: m_RootOrder
|
||||||
m_Icon: {fileID: 0}
|
value: 0
|
||||||
m_NavMeshLayer: 0
|
objectReference: {fileID: 0}
|
||||||
m_StaticEditorFlags: 0
|
m_RemovedComponents: []
|
||||||
m_IsActive: 1
|
m_ParentPrefab: {fileID: 100100000, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2}
|
||||||
--- !u!108 &1726972100
|
m_IsPrefabParent: 0
|
||||||
Light:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1726972099}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Type: 1
|
|
||||||
m_Color: {r: 1, g: .956862748, b: .839215696, a: 1}
|
|
||||||
m_Intensity: 1
|
|
||||||
m_Range: 10
|
|
||||||
m_SpotAngle: 30
|
|
||||||
m_CookieSize: 10
|
|
||||||
m_Shadows:
|
|
||||||
m_Type: 2
|
|
||||||
m_Resolution: -1
|
|
||||||
m_Strength: 1
|
|
||||||
m_Bias: .0500000007
|
|
||||||
m_NormalBias: .400000006
|
|
||||||
m_Cookie: {fileID: 0}
|
|
||||||
m_DrawHalo: 0
|
|
||||||
m_Flare: {fileID: 0}
|
|
||||||
m_RenderMode: 0
|
|
||||||
m_CullingMask:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_Lightmapping: 4
|
|
||||||
m_BounceIntensity: 1
|
|
||||||
m_ShadowRadius: 0
|
|
||||||
m_ShadowAngle: 0
|
|
||||||
m_AreaSize: {x: 1, y: 1}
|
|
||||||
--- !u!4 &1726972101
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1726972099}
|
|
||||||
m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054}
|
|
||||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_RootOrder: 1
|
|
||||||
--- !u!1 &1768239005
|
--- !u!1 &1768239005
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -249,7 +158,7 @@ Transform:
|
|||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1945388283}
|
- {fileID: 1945388283}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 1
|
||||||
--- !u!82 &1768239007
|
--- !u!82 &1768239007
|
||||||
AudioSource:
|
AudioSource:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -360,16 +269,23 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 1768239005}
|
m_GameObject: {fileID: 1768239005}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 05ec5cf00ca181d45a42ba1870e148c3, type: 3}
|
m_Script: {fileID: 11500000, guid: 4bcce75dab8f540b797340354c772d8b, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_IsWalking: 0
|
m_IsWalking: 0
|
||||||
m_WalkSpeed: 5
|
m_NbrAllumettes: 10
|
||||||
m_RunSpeed: 10
|
m_Briquets:
|
||||||
m_RunstepLenghten: .699999988
|
- {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2}
|
||||||
m_JumpSpeed: 10
|
- {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2}
|
||||||
m_StickToGroundForce: 10
|
- {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2}
|
||||||
m_GravityMultiplier: 2
|
m_Allumettes: {fileID: 11455286, guid: bdd994d2c872c9e4d8601100f973be0d, type: 2}
|
||||||
|
m_WalkSpeed: 0
|
||||||
|
m_RunSpeed: 0
|
||||||
|
m_Stamina: 1000
|
||||||
|
m_RunstepLenghten: 0
|
||||||
|
m_JumpSpeed: 0
|
||||||
|
m_StickToGroundForce: 0
|
||||||
|
m_GravityMultiplier: 0
|
||||||
m_MouseLook:
|
m_MouseLook:
|
||||||
XSensitivity: 2
|
XSensitivity: 2
|
||||||
YSensitivity: 2
|
YSensitivity: 2
|
||||||
@ -378,7 +294,7 @@ MonoBehaviour:
|
|||||||
MaximumX: 90
|
MaximumX: 90
|
||||||
smooth: 0
|
smooth: 0
|
||||||
smoothTime: 5
|
smoothTime: 5
|
||||||
m_UseFovKick: 1
|
m_UseFovKick: 0
|
||||||
m_FovKick:
|
m_FovKick:
|
||||||
Camera: {fileID: 0}
|
Camera: {fileID: 0}
|
||||||
originalFov: 0
|
originalFov: 0
|
||||||
@ -387,23 +303,13 @@ MonoBehaviour:
|
|||||||
TimeToDecrease: 1
|
TimeToDecrease: 1
|
||||||
IncreaseCurve:
|
IncreaseCurve:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Curve:
|
m_Curve: []
|
||||||
- time: 0
|
|
||||||
value: 0
|
|
||||||
inSlope: 0
|
|
||||||
outSlope: 0
|
|
||||||
tangentMode: 0
|
|
||||||
- time: 1
|
|
||||||
value: 1
|
|
||||||
inSlope: 2
|
|
||||||
outSlope: 2
|
|
||||||
tangentMode: 0
|
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_UseHeadBob: 1
|
m_UseHeadBob: 0
|
||||||
m_HeadBob:
|
m_HeadBob:
|
||||||
HorizontalBobRange: .100000001
|
HorizontalBobRange: .330000013
|
||||||
VerticalBobRange: .100000001
|
VerticalBobRange: .330000013
|
||||||
Bobcurve:
|
Bobcurve:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Curve:
|
m_Curve:
|
||||||
@ -434,16 +340,14 @@ MonoBehaviour:
|
|||||||
tangentMode: 0
|
tangentMode: 0
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
VerticaltoHorizontalRatio: 2
|
VerticaltoHorizontalRatio: 1
|
||||||
m_JumpBob:
|
m_JumpBob:
|
||||||
BobDuration: .200000003
|
BobDuration: 0
|
||||||
BobAmount: .100000001
|
BobAmount: 0
|
||||||
m_StepInterval: 5
|
m_StepInterval: 0
|
||||||
m_FootstepSounds:
|
m_FootstepSounds: []
|
||||||
- {fileID: 8300000, guid: 42e65e088b3f4374e851b8dbd38f3df9, type: 3}
|
m_JumpSound: {fileID: 0}
|
||||||
- {fileID: 8300000, guid: 8bc94ec6ed537e743b481638bdcd503d, type: 3}
|
m_LandSound: {fileID: 0}
|
||||||
m_JumpSound: {fileID: 8300000, guid: 5897aeed9b676024fbb8c694b421a861, type: 3}
|
|
||||||
m_LandSound: {fileID: 8300000, guid: 3b09d59f4499d45428baa7a21e954296, type: 3}
|
|
||||||
--- !u!1 &1945388278
|
--- !u!1 &1945388278
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
22
Assets/Scripts/Briquet.cs
Normal file
22
Assets/Scripts/Briquet.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class Briquet : MonoBehaviour {
|
||||||
|
|
||||||
|
public float m_Essence=500;
|
||||||
|
public bool activer;
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (activer)
|
||||||
|
{
|
||||||
|
m_Essence--;
|
||||||
|
print("SA brule");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Scripts/Briquet.cs.meta
Normal file
12
Assets/Scripts/Briquet.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8ea23fececeb311438b15c556d9620f8
|
||||||
|
timeCreated: 1446994977
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -11,8 +11,12 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
public class FirstPersonController : MonoBehaviour
|
public class FirstPersonController : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private bool m_IsWalking;
|
[SerializeField] private bool m_IsWalking;
|
||||||
|
[SerializeField] private int m_NbrAllumettes = 10;
|
||||||
|
[SerializeField] private Briquet[] m_Briquets;
|
||||||
|
[SerializeField] private Allumettes m_Allumettes;
|
||||||
[SerializeField] private float m_WalkSpeed;
|
[SerializeField] private float m_WalkSpeed;
|
||||||
[SerializeField] private float m_RunSpeed;
|
[SerializeField] private float m_RunSpeed;
|
||||||
|
[SerializeField] private float m_Stamina =1000;
|
||||||
[SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten;
|
[SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten;
|
||||||
[SerializeField] private float m_JumpSpeed;
|
[SerializeField] private float m_JumpSpeed;
|
||||||
[SerializeField] private float m_StickToGroundForce;
|
[SerializeField] private float m_StickToGroundForce;
|
||||||
@ -30,6 +34,8 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
|
|
||||||
private Camera m_Camera;
|
private Camera m_Camera;
|
||||||
private bool m_Jump;
|
private bool m_Jump;
|
||||||
|
private int indexBriquet;
|
||||||
|
private bool canSprint;
|
||||||
private float m_YRotation;
|
private float m_YRotation;
|
||||||
private Vector2 m_Input;
|
private Vector2 m_Input;
|
||||||
private Vector3 m_MoveDir = Vector3.zero;
|
private Vector3 m_MoveDir = Vector3.zero;
|
||||||
@ -41,10 +47,12 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
private float m_NextStep;
|
private float m_NextStep;
|
||||||
private bool m_Jumping;
|
private bool m_Jumping;
|
||||||
private AudioSource m_AudioSource;
|
private AudioSource m_AudioSource;
|
||||||
|
private MilesStonesPARA currentMilestone;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
currentMilestone = GameObject.FindGameObjectWithTag ("MilesStones").GetComponent<MilesStonesPARA>();
|
||||||
m_CharacterController = GetComponent<CharacterController>();
|
m_CharacterController = GetComponent<CharacterController>();
|
||||||
m_Camera = Camera.main;
|
m_Camera = Camera.main;
|
||||||
m_OriginalCameraPosition = m_Camera.transform.localPosition;
|
m_OriginalCameraPosition = m_Camera.transform.localPosition;
|
||||||
@ -108,6 +116,79 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
m_MoveDir.x = desiredMove.x*speed;
|
m_MoveDir.x = desiredMove.x*speed;
|
||||||
m_MoveDir.z = desiredMove.z*speed;
|
m_MoveDir.z = desiredMove.z*speed;
|
||||||
|
|
||||||
|
//Actions joueur
|
||||||
|
if(Input.GetButton("Briquet"))
|
||||||
|
{
|
||||||
|
//allumerBriquet
|
||||||
|
if(m_Briquets[indexBriquet]!=null)
|
||||||
|
{
|
||||||
|
//Si un briquet n'est pas déja allumé
|
||||||
|
if(!m_Briquets[indexBriquet].activer)
|
||||||
|
{
|
||||||
|
//Si il n'y a pas de briquet déja commencé
|
||||||
|
if(GameObject.FindGameObjectWithTag("Briquet")==null)
|
||||||
|
{
|
||||||
|
Instantiate(m_Briquets[indexBriquet]);
|
||||||
|
m_Briquets[indexBriquet] = GameObject.FindGameObjectWithTag("Briquet").GetComponent<Briquet>();
|
||||||
|
//Si il y a une allumette. Éteint la
|
||||||
|
}
|
||||||
|
if(GameObject.FindGameObjectWithTag("Allumettes")!=null)
|
||||||
|
{
|
||||||
|
m_NbrAllumettes--;
|
||||||
|
DestroyObject(GameObject.FindGameObjectWithTag("Allumettes"));
|
||||||
|
}
|
||||||
|
m_Briquets[indexBriquet].activer=true;
|
||||||
|
m_Briquets[indexBriquet].enabled = true;
|
||||||
|
}
|
||||||
|
//Si le briquet est déja allumé
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Briquets[indexBriquet].activer=false;
|
||||||
|
m_Briquets[indexBriquet].enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Si le briquet est vide, le jeté
|
||||||
|
if (m_Briquets[indexBriquet].m_Essence <= 0)
|
||||||
|
{
|
||||||
|
m_Briquets[indexBriquet].activer=false;
|
||||||
|
DestroyObject(m_Briquets[indexBriquet].gameObject);
|
||||||
|
indexBriquet++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Input.GetButton("Alumettes"))
|
||||||
|
{
|
||||||
|
//allumerAllumettes
|
||||||
|
if(m_NbrAllumettes>0)
|
||||||
|
{
|
||||||
|
//Si il y a un briquet, l'éteindre, mais le conservé
|
||||||
|
if(GameObject.FindGameObjectWithTag("Briquet")!=null)
|
||||||
|
{
|
||||||
|
m_Briquets[indexBriquet].activer=false;
|
||||||
|
m_Briquets[indexBriquet].enabled = false;
|
||||||
|
}
|
||||||
|
//Si il ny a pas d'allumettes déja allumé
|
||||||
|
if(GameObject.FindGameObjectWithTag("Allumettes")==null)
|
||||||
|
{
|
||||||
|
Instantiate(m_Allumettes);
|
||||||
|
GameObject.FindGameObjectWithTag("Allumettes").GetComponent<Allumettes>().activer=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Si l'allumette est morte
|
||||||
|
if(GameObject.FindGameObjectWithTag("Allumettes")!=null)
|
||||||
|
if(GameObject.FindGameObjectWithTag("Allumettes").GetComponent<Allumettes>().m_Duree<=0)
|
||||||
|
{
|
||||||
|
m_NbrAllumettes--;
|
||||||
|
DestroyObject(GameObject.FindGameObjectWithTag("Allumettes"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Input.GetButton("StopRespire"))
|
||||||
|
//Stopper la respiration et auguementer les sons
|
||||||
|
print("yo2");
|
||||||
|
else
|
||||||
|
//Repiration sounds
|
||||||
|
print("yo3");
|
||||||
|
|
||||||
if (m_CharacterController.isGrounded)
|
if (m_CharacterController.isGrounded)
|
||||||
{
|
{
|
||||||
@ -210,7 +291,29 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
#if !MOBILE_INPUT
|
#if !MOBILE_INPUT
|
||||||
// On standalone builds, walk/run speed is modified by a key press.
|
// On standalone builds, walk/run speed is modified by a key press.
|
||||||
// keep track of whether or not the character is walking or running
|
// keep track of whether or not the character is walking or running
|
||||||
m_IsWalking = !Input.GetKey(KeyCode.LeftShift);
|
m_IsWalking = !CrossPlatformInputManager.GetButton("Course");
|
||||||
|
//Si le joueur marche. Il reprend de l'énergie
|
||||||
|
if(m_IsWalking)
|
||||||
|
{
|
||||||
|
m_Stamina += 5;
|
||||||
|
if(m_Stamina >= 500)
|
||||||
|
canSprint=true;
|
||||||
|
if(m_Stamina >= 1000)
|
||||||
|
m_Stamina = 1000;
|
||||||
|
}
|
||||||
|
//Sinon il court, mais il perd de l'énergie
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Stamina -= 10;
|
||||||
|
if(m_Stamina < 0)
|
||||||
|
{
|
||||||
|
canSprint=false;
|
||||||
|
m_Stamina=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Si il n'a pas d'energie il doit marcher
|
||||||
|
if(!canSprint)
|
||||||
|
m_IsWalking=true;
|
||||||
#endif
|
#endif
|
||||||
// set the desired speed to be walking or running
|
// set the desired speed to be walking or running
|
||||||
speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed;
|
speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed;
|
||||||
@ -230,8 +333,6 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
StartCoroutine(!m_IsWalking ? m_FovKick.FOVKickUp() : m_FovKick.FOVKickDown());
|
StartCoroutine(!m_IsWalking ? m_FovKick.FOVKickUp() : m_FovKick.FOVKickDown());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RotateView()
|
private void RotateView()
|
||||||
{
|
{
|
||||||
m_MouseLook.LookRotation (transform, m_Camera.transform);
|
m_MouseLook.LookRotation (transform, m_Camera.transform);
|
||||||
@ -241,6 +342,11 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
private void OnControllerColliderHit(ControllerColliderHit hit)
|
private void OnControllerColliderHit(ControllerColliderHit hit)
|
||||||
{
|
{
|
||||||
Rigidbody body = hit.collider.attachedRigidbody;
|
Rigidbody body = hit.collider.attachedRigidbody;
|
||||||
|
//Si le joueur touche un piege le blessant
|
||||||
|
if(hit.collider.tag == "Trap")
|
||||||
|
{
|
||||||
|
hurtPlayer();
|
||||||
|
}
|
||||||
//dont move the rigidbody if the character is on top of it
|
//dont move the rigidbody if the character is on top of it
|
||||||
if (m_CollisionFlags == CollisionFlags.Below)
|
if (m_CollisionFlags == CollisionFlags.Below)
|
||||||
{
|
{
|
||||||
@ -253,5 +359,17 @@ namespace UnityStandardAssets.Characters.FirstPerson
|
|||||||
}
|
}
|
||||||
body.AddForceAtPosition(m_CharacterController.velocity*0.1f, hit.point, ForceMode.Impulse);
|
body.AddForceAtPosition(m_CharacterController.velocity*0.1f, hit.point, ForceMode.Impulse);
|
||||||
}
|
}
|
||||||
|
//Si le joueur est blessé, il est de retour au point de réapparition
|
||||||
|
public void hurtPlayer()
|
||||||
|
{
|
||||||
|
print ("I'm hurt");
|
||||||
|
m_Briquets [m_Briquets.Length - 1] = new Briquet ();
|
||||||
|
transform.position = currentMilestone.Respawn.transform.position;
|
||||||
|
transform.rotation = currentMilestone.Respawn.transform.rotation;
|
||||||
|
}
|
||||||
|
public void deathPlayer()
|
||||||
|
{
|
||||||
|
print ("I'm dead");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
Assets/Scripts/MilesStonesPARA.cs
Normal file
19
Assets/Scripts/MilesStonesPARA.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class MilesStonesPARA : MonoBehaviour {
|
||||||
|
|
||||||
|
[SerializeField] private float timeMinToFinish;
|
||||||
|
[SerializeField] public GameObject Respawn;
|
||||||
|
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Scripts/MilesStonesPARA.cs.meta
Normal file
12
Assets/Scripts/MilesStonesPARA.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9dc35e923ff865d4889ba28eb1b64fd5
|
||||||
|
timeCreated: 1446994977
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -186,8 +186,8 @@ InputManager:
|
|||||||
descriptiveName:
|
descriptiveName:
|
||||||
descriptiveNegativeName:
|
descriptiveNegativeName:
|
||||||
negativeButton:
|
negativeButton:
|
||||||
positiveButton: joystick button 0
|
positiveButton: joystick button 8
|
||||||
altNegativeButton:
|
altNegativeButton: left shift
|
||||||
altPositiveButton:
|
altPositiveButton:
|
||||||
gravity: 1000
|
gravity: 1000
|
||||||
dead: .00100000005
|
dead: .00100000005
|
||||||
@ -203,7 +203,7 @@ InputManager:
|
|||||||
descriptiveNegativeName:
|
descriptiveNegativeName:
|
||||||
negativeButton:
|
negativeButton:
|
||||||
positiveButton: joystick button 1
|
positiveButton: joystick button 1
|
||||||
altNegativeButton:
|
altNegativeButton: z
|
||||||
altPositiveButton:
|
altPositiveButton:
|
||||||
gravity: 1000
|
gravity: 1000
|
||||||
dead: .00100000005
|
dead: .00100000005
|
||||||
@ -219,7 +219,7 @@ InputManager:
|
|||||||
descriptiveNegativeName:
|
descriptiveNegativeName:
|
||||||
negativeButton:
|
negativeButton:
|
||||||
positiveButton: joystick button 2
|
positiveButton: joystick button 2
|
||||||
altNegativeButton:
|
altNegativeButton: x
|
||||||
altPositiveButton:
|
altPositiveButton:
|
||||||
gravity: 1000
|
gravity: 1000
|
||||||
dead: .00100000005
|
dead: .00100000005
|
||||||
@ -230,12 +230,12 @@ InputManager:
|
|||||||
axis: 0
|
axis: 0
|
||||||
joyNum: 0
|
joyNum: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
m_Name: Jump
|
m_Name: StopRespire
|
||||||
descriptiveName:
|
descriptiveName:
|
||||||
descriptiveNegativeName:
|
descriptiveNegativeName:
|
||||||
negativeButton:
|
negativeButton:
|
||||||
positiveButton: joystick button 3
|
positiveButton: joystick button 9
|
||||||
altNegativeButton:
|
altNegativeButton: space
|
||||||
altPositiveButton:
|
altPositiveButton:
|
||||||
gravity: 1000
|
gravity: 1000
|
||||||
dead: .00100000005
|
dead: .00100000005
|
||||||
|
|||||||
@ -8,6 +8,7 @@ PlayerSettings:
|
|||||||
defaultScreenOrientation: 4
|
defaultScreenOrientation: 4
|
||||||
targetDevice: 2
|
targetDevice: 2
|
||||||
targetResolution: 0
|
targetResolution: 0
|
||||||
|
useOnDemandResources: 0
|
||||||
accelerometerFrequency: 60
|
accelerometerFrequency: 60
|
||||||
companyName: DefaultCompany
|
companyName: DefaultCompany
|
||||||
productName: EscapeTheRoom
|
productName: EscapeTheRoom
|
||||||
@ -28,6 +29,7 @@ PlayerSettings:
|
|||||||
androidShowActivityIndicatorOnLoading: -1
|
androidShowActivityIndicatorOnLoading: -1
|
||||||
iosAppInBackgroundBehavior: 0
|
iosAppInBackgroundBehavior: 0
|
||||||
displayResolutionDialog: 1
|
displayResolutionDialog: 1
|
||||||
|
iosAllowHTTPDownload: 1
|
||||||
allowedAutorotateToPortrait: 1
|
allowedAutorotateToPortrait: 1
|
||||||
allowedAutorotateToPortraitUpsideDown: 1
|
allowedAutorotateToPortraitUpsideDown: 1
|
||||||
allowedAutorotateToLandscapeRight: 1
|
allowedAutorotateToLandscapeRight: 1
|
||||||
@ -135,6 +137,15 @@ PlayerSettings:
|
|||||||
iOSLaunchScreenFillPct: 100
|
iOSLaunchScreenFillPct: 100
|
||||||
iOSLaunchScreenSize: 100
|
iOSLaunchScreenSize: 100
|
||||||
iOSLaunchScreenCustomXibPath:
|
iOSLaunchScreenCustomXibPath:
|
||||||
|
iOSLaunchScreeniPadType: 0
|
||||||
|
iOSLaunchScreeniPadImage: {fileID: 0}
|
||||||
|
iOSLaunchScreeniPadBackgroundColor:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
iOSLaunchScreeniPadFillPct: 100
|
||||||
|
iOSLaunchScreeniPadSize: 100
|
||||||
|
iOSLaunchScreeniPadCustomXibPath:
|
||||||
|
iOSDeviceRequirements: []
|
||||||
AndroidTargetDevice: 0
|
AndroidTargetDevice: 0
|
||||||
AndroidSplashScreenScale: 0
|
AndroidSplashScreenScale: 0
|
||||||
androidSplashScreen: {fileID: 0}
|
androidSplashScreen: {fileID: 0}
|
||||||
@ -152,8 +163,10 @@ PlayerSettings:
|
|||||||
m_BuildTargetIcons:
|
m_BuildTargetIcons:
|
||||||
- m_BuildTarget:
|
- m_BuildTarget:
|
||||||
m_Icons:
|
m_Icons:
|
||||||
- m_Icon: {fileID: 0}
|
- serializedVersion: 2
|
||||||
m_Size: 0
|
m_Icon: {fileID: 0}
|
||||||
|
m_Width: 0
|
||||||
|
m_Height: 0
|
||||||
m_BuildTargetBatching: []
|
m_BuildTargetBatching: []
|
||||||
m_BuildTargetGraphicsAPIs: []
|
m_BuildTargetGraphicsAPIs: []
|
||||||
webPlayerTemplate: APPLICATION:Default
|
webPlayerTemplate: APPLICATION:Default
|
||||||
@ -228,6 +241,8 @@ PlayerSettings:
|
|||||||
ps4SdkOverride:
|
ps4SdkOverride:
|
||||||
ps4BGMPath:
|
ps4BGMPath:
|
||||||
ps4ShareFilePath:
|
ps4ShareFilePath:
|
||||||
|
ps4ShareOverlayImagePath:
|
||||||
|
ps4PrivacyGuardImagePath:
|
||||||
ps4NPtitleDatPath:
|
ps4NPtitleDatPath:
|
||||||
ps4RemotePlayKeyAssignment: -1
|
ps4RemotePlayKeyAssignment: -1
|
||||||
ps4RemotePlayKeyMappingDir:
|
ps4RemotePlayKeyMappingDir:
|
||||||
@ -245,10 +260,13 @@ PlayerSettings:
|
|||||||
ps4pnGameCustomData: 1
|
ps4pnGameCustomData: 1
|
||||||
playerPrefsSupport: 0
|
playerPrefsSupport: 0
|
||||||
ps4ReprojectionSupport: 0
|
ps4ReprojectionSupport: 0
|
||||||
|
ps4UseAudio3dBackend: 0
|
||||||
|
ps4Audio3dVirtualSpeakerCount: 14
|
||||||
ps4attribUserManagement: 0
|
ps4attribUserManagement: 0
|
||||||
ps4attribMoveSupport: 0
|
ps4attribMoveSupport: 0
|
||||||
ps4attrib3DSupport: 0
|
ps4attrib3DSupport: 0
|
||||||
ps4attribShareSupport: 0
|
ps4attribShareSupport: 0
|
||||||
|
ps4IncludedModules: []
|
||||||
monoEnv:
|
monoEnv:
|
||||||
psp2Splashimage: {fileID: 0}
|
psp2Splashimage: {fileID: 0}
|
||||||
psp2NPTrophyPackPath:
|
psp2NPTrophyPackPath:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user