Пример #1
0
 private void Awake()
 {
     if (instance)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
     }
 }
    protected override void OnUpdate()
    {
        Entities.ForEach((ref Translation translation, ref Particle particle) =>
        {
            //move particle to its point
            int particleIndex         = particle.index;
            ParticlesECS bootstrapper = ParticlesECS.GetInstance();
            float3 currentPos         = translation.Value;
            float3 targetPos          = bootstrapper.points[particleIndex];

            translation.Value = new float3(math.lerp(currentPos, targetPos, bootstrapper.speedNormal));
        });
    }