46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using Code.Infrastructure.Generators;
|
|
using UnityEngine;
|
|
using UnityEngine.AddressableAssets;
|
|
|
|
namespace Code.Infrastructure.Particles
|
|
{
|
|
[CreateAssetMenu(fileName = "ParticleInfo", menuName = "Configs/Particles/ParticleInfo")]
|
|
[Config("Configs/Particles/ParticleInfo", true)]
|
|
public class ParticleInfo : ScriptableObject
|
|
{
|
|
public AssetReference particleSystem;
|
|
public int particleId;
|
|
public ParticlePartition particlePartition;
|
|
public int CountInPool;
|
|
public ParticlePartitionIDPair PartitionIDPair;
|
|
}
|
|
|
|
[Serializable]
|
|
public struct ParticlePartitionIDPair : IEquatable<ParticlePartitionIDPair>
|
|
{
|
|
public ParticlePartition ParticlePartition;
|
|
public int ID;
|
|
|
|
public ParticlePartitionIDPair(ParticlePartition particlePartition, int id)
|
|
{
|
|
ParticlePartition = particlePartition;
|
|
ID = id;
|
|
}
|
|
|
|
public bool Equals(ParticlePartitionIDPair other)
|
|
{
|
|
return ParticlePartition == other.ParticlePartition && ID == other.ID;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is ParticlePartitionIDPair other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine((int)ParticlePartition, ID);
|
|
}
|
|
}
|
|
} |