protected virtual void UpdateProjectileColor(ref ProjectileData data) { data.Color = Color.Evaluate(1 - data.TimeToLive / TimeToLive); if (data.Outline.Item != null) { data.Outline.Item.Color = OutlineColor.Evaluate(1 - data.TimeToLive / TimeToLive); } }
public void UpdateBufferData(ProjectilePrefab projectileType, ProjectileData data) { if (projectileType.Index != LastAccessedProjectileTypeIndex) { LastAccessedProjectileTypeIndex = projectileType.Index; LastAccessedRenderer = IndirectRenderers[LastAccessedProjectileTypeIndex]; } LastAccessedRenderer.UpdateBufferData(projectileType.BufferIndex, data); projectileType.IncrementBufferIndex(); }
public void UpdateBufferData(int index, ProjectileType projectileType, ProjectileData data) { if (projectileType.Index != LastAccessedProjectileTypeIndex) { LastAccessedProjectileTypeIndex = projectileType.Index; LastAccessedRenderer = IndirectRenderers[LastAccessedProjectileTypeIndex]; } LastAccessedRenderer.UpdateBufferData(projectileType.BufferIndex, data); projectileType.BufferIndex++; }
private void UpdateProjectileNodePulse(float tick, ref ProjectileData data) { if (UseColorPulse && !UseStaticPulse) { data.Pulse.Update(tick, PulseSpeed); } if (UseOutlineColorPulse && !UseOutlineStaticPulse) { data.OutlinePulse.Update(tick, OutlinePulseSpeed); } }
public void UpdateBufferData(int index, ProjectileData data) { if (index < TransformData.Length) { TransformData[index] = new Vector4(data.Position.x, data.Position.y, data.Scale, data.Rotation); if (!StaticColor) { ColorData[index] = new Vector4(data.Color.r, data.Color.g, data.Color.b, data.Color.a); } } else { Debug.Log("Error: Initialized more projectiles than Projectile Type allows."); } }
protected override void UpdateProjectileColor(ref ProjectileData data) { // foreground if (UseColorPulse) { if (UseStaticPulse) { data.Color = Color.Evaluate(StaticPulse.Fraction); } else { data.Color = Color.Evaluate(data.Pulse.Fraction); } } else { data.Color = Color.Evaluate(1 - data.TimeToLive / TimeToLive); } //outline if (data.Outline.Item != null) { if (UseOutlineColorPulse) { if (UseOutlineStaticPulse) { data.Outline.Item.Color = OutlineColor.Evaluate(StaticOutlinePulse.Fraction); } else { data.Outline.Item.Color = OutlineColor.Evaluate(data.OutlinePulse.Fraction); } } else { data.Outline.Item.Color = OutlineColor.Evaluate(1 - data.TimeToLive / TimeToLive); } } }