Compare commits

..

No commits in common. "007350dc3fa732a3d64bf01a892f6e560bde54f4" and "04306cbb768ac39ec3f1b4332937d316d59678f8" have entirely different histories.

4 changed files with 24 additions and 73 deletions

View File

@ -22,4 +22,3 @@ MonoBehaviour:
- {fileID: 8300000, guid: ad2e8b18611ebba43823cd2f2381dc0b, type: 3}
- {fileID: 8300000, guid: b388d47fcdeb4434bb6b8f8617c8031f, type: 3}
- {fileID: 8300000, guid: 79ca1f1673c4d574d8424e518f9c3517, type: 3}
- {fileID: 8300000, guid: e850f3f8ab5051943a09bc30110ad96a, type: 3}

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@ ParticleSystem:
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
emitterVelocityMode: 1
looping: 0
looping: 1
prewarm: 0
playOnAwake: 1
useUnscaledTime: 0
@ -5041,10 +5041,6 @@ MonoBehaviour:
damage: 10
wallRebounces: 4
comingFrom: {fileID: 0}
OnReflect:
m_PersistentCalls:
m_Calls: []
splashPS: {fileID: 2459575551296835979}
--- !u!108 &8572678539923306418
Light:
m_ObjectHideFlags: 0

View File

@ -24,8 +24,6 @@ public class Projectile : MonoBehaviour
private Vector3 prevVel;
[SerializeField] ParticleSystem splashPS;
private void Awake()
{
projCol = GetComponent<Collider>();
@ -42,15 +40,6 @@ public class Projectile : MonoBehaviour
projCol.material = pMat;
}
void Start()
{
if (splashPS != null)
{
splashPS.time = 0f;
splashPS.Play();
}
}
private void LateUpdate()
{
prevVel = body.velocity;
@ -60,7 +49,7 @@ public class Projectile : MonoBehaviour
{
HealthComponent hitHealthComp = collision.gameObject.GetComponent<HealthComponent>();
if (hitHealthComp == null)
hitHealthComp = collision.transform.parent.GetComponent<HealthComponent>();
hitHealthComp = collision.transform.root.GetComponentInChildren<HealthComponent>();
// if (hitHealthComp == comingFrom) return;
if (hitHealthComp)
{
@ -77,12 +66,6 @@ public class Projectile : MonoBehaviour
body.velocity = newVel.normalized * prevVel.magnitude * bounciness;
OnReflect?.Invoke();
AudioManager.PlaySound("BulletBounce", transform.position);
if (splashPS != null)
{
splashPS.time = 0f;
splashPS.Play();
}
}
}
}