2022-02-14 23:25:42 +00:00
|
|
|
|
using QSB.WorldSync;
|
2021-11-14 00:57:06 +00:00
|
|
|
|
using UnityEngine;
|
2021-11-11 02:40:02 +00:00
|
|
|
|
|
|
|
|
|
namespace QSB.MeteorSync.WorldObjects
|
|
|
|
|
{
|
|
|
|
|
public class QSBMeteor : WorldObject<MeteorController>
|
|
|
|
|
{
|
2022-01-26 07:40:38 +00:00
|
|
|
|
public override void SendInitialState(uint to)
|
2022-01-26 05:08:04 +00:00
|
|
|
|
{
|
2022-01-26 09:01:32 +00:00
|
|
|
|
// todo SendInitialState
|
2022-01-26 05:08:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-11-14 07:29:06 +00:00
|
|
|
|
public static bool IsSpecialImpact(GameObject go) =>
|
2022-02-14 23:25:43 +00:00
|
|
|
|
go == Locator.GetPlayerCollider().gameObject || (Locator.GetProbe() != null && go == Locator.GetProbe()._anchor._collider.gameObject);
|
2021-11-14 07:29:06 +00:00
|
|
|
|
|
|
|
|
|
public void SpecialImpact()
|
|
|
|
|
{
|
|
|
|
|
AttachedObject._intactRenderer.enabled = false;
|
|
|
|
|
AttachedObject._impactLight.enabled = true;
|
|
|
|
|
AttachedObject._impactLight.intensity = AttachedObject._impactLightCurve.Evaluate(0f);
|
|
|
|
|
foreach (var particleSystem in AttachedObject._impactParticles)
|
|
|
|
|
{
|
|
|
|
|
particleSystem.Play();
|
|
|
|
|
}
|
2021-11-25 15:38:05 +00:00
|
|
|
|
|
2021-11-14 07:29:06 +00:00
|
|
|
|
AttachedObject._impactSource.PlayOneShot(AudioType.BH_MeteorImpact);
|
|
|
|
|
foreach (var owCollider in AttachedObject._owColliders)
|
|
|
|
|
{
|
|
|
|
|
owCollider.SetActivation(false);
|
|
|
|
|
}
|
2021-11-25 15:38:05 +00:00
|
|
|
|
|
2021-11-14 07:29:06 +00:00
|
|
|
|
AttachedObject._owRigidbody.MakeKinematic();
|
|
|
|
|
FragmentSurfaceProxy.UntrackMeteor(AttachedObject);
|
|
|
|
|
FragmentCollisionProxy.UntrackMeteor(AttachedObject);
|
|
|
|
|
AttachedObject._ignoringCollisions = false;
|
|
|
|
|
AttachedObject._hasImpacted = true;
|
|
|
|
|
AttachedObject._impactTime = Time.time;
|
|
|
|
|
}
|
2021-11-11 02:40:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|