Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:11:59 +09:30
commit 7f792f7b8f
25 changed files with 1947 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class AutoRemove : TrackedBehaviourBase
{
public float lifetime = -1;
protected override void Awake()
{
ExplosionValue value = CustomExplosionManager.LastInitializedComponent;
lifetime = value.CurrentExplosionParams._explosionData.Duration;
if(lifetime > 0)
syncOnConnect = value.Component.SyncOnConnect;
base.Awake();
if (lifetime > 0)
Destroy(gameObject, lifetime);
}
private void Update()
{
if(lifetime > 0)
lifetime -= Time.deltaTime;
}
protected override void OnDestroy()
{
base.OnDestroy();
CustomExplosionManager.removeInitializedParticle(gameObject);
}
protected override void OnClientConnected(PooledBinaryWriter _bw)
{
_bw.Write(lifetime);
}
protected override void OnConnectedToServer(PooledBinaryReader _br)
{
lifetime = _br.ReadSingle();
if (lifetime > 0)
Destroy(gameObject, lifetime);
}
}