This commit is contained in:
Sewmina Dilshan 2023-01-26 17:59:47 +05:30
parent fb0c628025
commit 8fbff2f0c7
8 changed files with 181 additions and 3 deletions

View File

@ -2772,6 +2772,7 @@ GameObject:
- component: {fileID: 1846706272}
- component: {fileID: 1846706271}
- component: {fileID: 1846706273}
- component: {fileID: 1846706274}
m_Layer: 3
m_Name: Player
m_TagString: Untagged
@ -2861,15 +2862,114 @@ MonoBehaviour:
normalSprite: {fileID: 21300000, guid: 9b00ede2559ce684c807348f2695f991, type: 3}
UpMoneyEffect: {fileID: 795861012}
effectOffset: {x: 0.34, y: 0.37, z: 0}
boostAudioPitchRate: 0.01
boostAudioPitchMax: 2
boostAudioPitchMin: 1
eulerAngles: {x: 0, y: 0, z: 0}
movingSpeed: 0.1
boostSpeed: 0.01
turnAngle: 31
trailPrefab: {fileID: 1182127216}
currentTrail: {fileID: 0}
upSFX: {fileID: 8300000, guid: 015252040765e487aa7b2cc3464a1c1d, type: 3}
downSFX: {fileID: 8300000, guid: 015252040765e487aa7b2cc3464a1c1d, type: 3}
upSFX: {fileID: 8300000, guid: 2eb1eb5737c586c43aa6006f532e4e9c, type: 3}
downSFX: {fileID: 8300000, guid: 2eb1eb5737c586c43aa6006f532e4e9c, type: 3}
senseRadius: 0.58
--- !u!82 &1846706274
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1846706270}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
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!1 &1869695151
GameObject:
m_ObjectHideFlags: 0

View File

@ -12,11 +12,15 @@ public class PlayerController : MonoBehaviour
public Vector3 effectOffset;
float defeaultEmitRate;
public static Transform t {get {return instance.transform; }}
// private AudioSource boostAudio;
public float boostAudioPitchRate = 0.01f;
public float boostAudioPitchMax,boostAudioPitchMin;
void Awake(){
defeaultEmitRate = UpMoneyEffect.emissionRate;
UpMoneyEffect.emissionRate = 0;
instance= this;
spriteRenderer = GetComponent<SpriteRenderer>();
// boostAudio = GetComponent<AudioSource>();
}
public Vector3 eulerAngles;
public float movingSpeed = 1;
@ -54,6 +58,8 @@ public class PlayerController : MonoBehaviour
void FixedUpdate()
{
if(!Started){return;}
// boostAudio.pitch += ((isUp) ? 1 : -1 ) * boostAudioPitchRate;
// boostAudio.pitch = Mathf.Clamp(boostAudio.pitch, boostAudioPitchMin, boostAudioPitchMax);
transform.Translate(transform.right * movingSpeed);
eulerAngles = transform.eulerAngles;
@ -84,6 +90,8 @@ public class PlayerController : MonoBehaviour
// if(transform.position.y < 250){boostingSpeed = boostSpeed/2f;}
ToggleUpmoneyEffect(true);
if(perc > 1){
GetComponent<AudioSource>().PlayOneShot(upSFX);
while(transform.position.y < newY){
transform.position += new Vector3(0,boostingSpeed,0);
@ -101,6 +109,9 @@ public class PlayerController : MonoBehaviour
boosting=false;
ToggleUpmoneyEffect(false);
GetComponent<AudioSource>().Stop();
}
@ -109,6 +120,7 @@ public class PlayerController : MonoBehaviour
gameStarted = true;
GameManager.instance.StartGame();
Started=true;
// boostAudio.Play();
}
transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, isUp ? -turnAngle : turnAngle);

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 2eb1eb5737c586c43aa6006f532e4e9c
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: f798bbd32a1ea2f46ab6514da8cbb4b3
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 7861c5af539f10942a3b93d3304938ec
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant: