Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 24 additions & 21 deletions apps/saber/Assets/Resources/Prefabs/Dragon_Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,8 @@ GameObject:
- component: {fileID: 3685274458058455827}
- component: {fileID: 1814664003781696986}
- component: {fileID: 1361789922433946004}
- component: {fileID: -3345975177154981130}
- component: {fileID: -7148950099368602791}
- component: {fileID: -5176747277676872433}
- component: {fileID: 7778633322916403597}
m_Layer: 6
m_Name: Dragon_Player
m_TagString: Player
Expand Down Expand Up @@ -1243,6 +1243,7 @@ MonoBehaviour:
maxSlopeAngle: 40
jumpKey: 32
sprintKey: 304
jump: []
state: 0
--- !u!95 &1814664003781696986
Animator:
Expand Down Expand Up @@ -1292,7 +1293,26 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 112
m_CollisionDetection: 0
--- !u!82 &-3345975177154981130
--- !u!114 &-5176747277676872433
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4074204764314864580}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1efd3b9600d8714d8e2b451329af69a, type: 3}
m_Name:
m_EditorClassIdentifier:
_wingFlap:
- {fileID: 8300000, guid: 6e22aeab397131d4092881ce44338c4e, type: 3}
- {fileID: 8300000, guid: ab529dde5f93e264d8fa53feba0555a4, type: 3}
- {fileID: 8300000, guid: 32fc5494a1efa604889da9f7c7031820, type: 3}
- {fileID: 8300000, guid: b6f7c3d3981cbb34f905973788bbf244, type: 3}
- {fileID: 8300000, guid: 5b6c15a3eade44a4d917ce5e2dd0dcdc, type: 3}
_dragonland: []
--- !u!82 &7778633322916403597
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
Expand All @@ -1301,8 +1321,7 @@ AudioSource:
m_GameObject: {fileID: 4074204764314864580}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -4118932164944524272, guid: e07183f7020ec584b893cdcdb771fc79,
type: 2}
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
Expand Down Expand Up @@ -1389,22 +1408,6 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &-7148950099368602791
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4074204764314864580}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1efd3b9600d8714d8e2b451329af69a, type: 3}
m_Name:
m_EditorClassIdentifier:
jump: []
wingFlap: []
attack: []
land: []
--- !u!1 &4185366655547599162
GameObject:
m_ObjectHideFlags: 0
Expand Down
125 changes: 124 additions & 1 deletion apps/saber/Assets/Scenes/Scene1.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.1470247, g: 0.36394262, b: 0.5799059, a: 1}
m_IndirectSpecularColor: {r: 0.14703594, g: 0.36398482, b: 0.57992315, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -568,6 +568,8 @@ GameObject:
- component: {fileID: 139766772}
- component: {fileID: 139766771}
- component: {fileID: 139766770}
- component: {fileID: 139766773}
- component: {fileID: 139766774}
m_Layer: 6
m_Name: Player
m_TagString: Player
Expand Down Expand Up @@ -620,6 +622,11 @@ MonoBehaviour:
maxSlopeAngle: 40
jumpKey: 32
sprintKey: 304
jump:
- {fileID: 8300000, guid: 23fc8f4eae0217d4f896d546597f5da8, type: 3}
- {fileID: 8300000, guid: 98c772824f7b23d49b78cd3428b418d7, type: 3}
- {fileID: 8300000, guid: 78ea29ad3f0ab634fa492abeade70123, type: 3}
- {fileID: 8300000, guid: ea69851f82c13344b9653b6165ab6c2d, type: 3}
state: 0
--- !u!54 &139766771
Rigidbody:
Expand Down Expand Up @@ -669,6 +676,122 @@ Animator:
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!82 &139766773
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 139766767}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -4118932164944524272, guid: e07183f7020ec584b893cdcdb771fc79,
type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &139766774
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 139766767}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1efd3b9600d8714d8e2b451329af69a, type: 3}
m_Name:
m_EditorClassIdentifier:
_wingFlap:
- {fileID: 8300000, guid: 6e22aeab397131d4092881ce44338c4e, type: 3}
- {fileID: 8300000, guid: ab529dde5f93e264d8fa53feba0555a4, type: 3}
- {fileID: 8300000, guid: 32fc5494a1efa604889da9f7c7031820, type: 3}
- {fileID: 8300000, guid: b6f7c3d3981cbb34f905973788bbf244, type: 3}
- {fileID: 8300000, guid: 5b6c15a3eade44a4d917ce5e2dd0dcdc, type: 3}
_dragonland: []
--- !u!1 &168443273
GameObject:
m_ObjectHideFlags: 0
Expand Down
21 changes: 15 additions & 6 deletions apps/saber/Assets/Scripts/AudioScripts/PlayerFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@
public class PlayerFX : MonoBehaviour
{
private AudioSource _dragonSource;
[SerializeField] AudioClip[] jump;
[SerializeField] AudioClip[] wingFlap;
[SerializeField] AudioClip[] attack;
[SerializeField] AudioClip[] land;
[SerializeField] AudioClip[] _wingFlap;
[SerializeField] AudioClip[] _dragonland;
// Start is called before the first frame update
void Start()
void Awake()
{

_dragonSource = GetComponent<AudioSource>();
}

// Update is called once per frame
void Update()
{

}

public void WingFlap()
{
_dragonSource.PlayOneShot(_wingFlap[Random.Range(0, _wingFlap.Length)]);
}


public void DragonLand()
{
_dragonSource.PlayOneShot(_dragonland[Random.Range(0, _dragonland.Length)]);
}
}
28 changes: 21 additions & 7 deletions apps/saber/Assets/Scripts/Movement/PlayerMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,16 @@ public class PlayerMovement : MonoBehaviour
bool jumping; // Is the player jumping
bool canJump = true; // can the player jump
RaycastHit slopeHit; // Hit information for the slope

[Tooltip("Player's current movement state")]

#region Pablo

private AudioSource _dragonSource;
[SerializeField] AudioClip[] jump;


#endregion

[Tooltip("Player's current movement state")]
public MovementState state;
public enum MovementState
{
Expand All @@ -80,10 +88,13 @@ void Awake()
cam = Camera.main;
animator = GetComponent<Animator>();
Cursor.lockState = CursorLockMode.Locked;
}
#region Pablo
_dragonSource = GetComponent<AudioSource>();
#endregion
}

// Update is called once per frame
void Update()
// Update is called once per frame
void Update()
{
isGrounded = GroundCheck(); // checks if player is on ground
animator.SetBool("Grounded", isGrounded);
Expand Down Expand Up @@ -204,8 +215,11 @@ void Jump()
float initialVelocity = Mathf.Sqrt(-2f * gravityScale * jumpForce);
rb.AddForce(transform.up * initialVelocity, ForceMode.Impulse);
animator.SetTrigger("Jump");
}
void ResetJump()
#region Pablo
_dragonSource.PlayOneShot(jump[Random.Range(0, jump.Length)]);
#endregion
}
void ResetJump()
{
canJump = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "lightmapping.autoUnwrapLightmapUV",
"value": "{\"m_Value\":true}"

}
]
}
Expand Down