r2mods/ilspy_dump/ror2_csproj/RoR2.Projectile/ProjectileGhostCluster.cs

35 lines
889 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2.Projectile;
public class ProjectileGhostCluster : MonoBehaviour
{
public GameObject ghostClusterPrefab;
public int clusterCount;
public bool distributeEvenly;
public float clusterDistance;
private void Start()
{
float num = 1f / (Mathf.Log(clusterCount, 4f) + 1f);
Vector3 position = base.transform.position;
for (int i = 0; i < clusterCount; i++)
{
GameObject obj = Object.Instantiate(position: position + ((!distributeEvenly) ? (Random.insideUnitSphere * clusterDistance) : Vector3.zero), original: ghostClusterPrefab, rotation: Quaternion.identity, parent: base.transform);
obj.transform.localScale = Vector3.one / (Mathf.Log(clusterCount, 4f) + 1f);
TrailRenderer component = obj.GetComponent<TrailRenderer>();
if ((bool)component)
{
component.widthMultiplier *= num;
}
}
}
private void Update()
{
}
}