Update Cannon Shooting Effect
This commit is contained in:
parent
819fdbe401
commit
9594fddfb6
97
Unity-Files/Assets/Examples/Defender/Defender.unity
generated
97
Unity-Files/Assets/Examples/Defender/Defender.unity
generated
@ -1315,6 +1315,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 565676025}
|
||||
- component: {fileID: 565676026}
|
||||
- component: {fileID: 565676028}
|
||||
m_Layer: 0
|
||||
m_Name: Shooter
|
||||
m_TagString: Player
|
||||
@ -1354,6 +1355,102 @@ MonoBehaviour:
|
||||
shootSpeed: 5
|
||||
shootDirection: {x: 0, y: 1}
|
||||
relativeToRotation: 1
|
||||
--- !u!82 &565676028
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 565676024}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 6b8e3c84427db0e4583454e3b7fb843a, type: 3}
|
||||
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!1 &605827951
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -18,7 +18,7 @@ public class DifficultyScale : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (((Mathf.FloorToInt(time.GetComponent<UITimer>().time) - (incrementAmountInSeconds * currentDifficultyLevel)) / incrementDifficultyInSeconds) + 1 == 2)
|
||||
if (((Mathf.FloorToInt(time.GetComponent<UITimer>().time) - (incrementAmountInSeconds * currentDifficultyLevel)) / incrementDifficultyInSeconds) == 1)
|
||||
{
|
||||
currentDifficultyLevel++;
|
||||
incrementDifficultyInSeconds += incrementAmountInSeconds;
|
||||
|
@ -57,6 +57,10 @@ public class ObjectShooter : MonoBehaviour
|
||||
if(rigidbody2D != null)
|
||||
{
|
||||
rigidbody2D.AddForce(actualBulletDirection * shootSpeed, ForceMode2D.Impulse);
|
||||
if (GetComponent<AudioSource>() != null)
|
||||
{
|
||||
GetComponent<AudioSource>().Play();
|
||||
}
|
||||
}
|
||||
|
||||
// add a Bullet component if the prefab doesn't already have one, and assign the player ID
|
||||
|
Loading…
x
Reference in New Issue
Block a user