32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class Trail : BaseElement
|
|
{
|
|
public TrailRenderer trailRenderer;
|
|
public Material renderMaterial;
|
|
|
|
public float visibleTimeLength;
|
|
|
|
public static Trail GenerateElement(string name, Guid id, List<string> tags,
|
|
BaseElement parentElement, float visibleTimeLength, Material material = null)
|
|
{
|
|
Trail trail = Instantiate(EditorManager.instance.basePrefabs.trail).GetComponent<Trail>();
|
|
trail.trailRenderer = trail.GetComponent<TrailRenderer>();
|
|
|
|
trail.Initialize(name, id, tags);
|
|
trail.renderMaterial = material == null ? EditorManager.instance.basePrefabs.defaultTrailMaterial : material;
|
|
trail.trailRenderer.material = trail.renderMaterial;
|
|
trail.visibleTimeLength = visibleTimeLength;
|
|
trail.SetParent(parentElement);
|
|
|
|
trail.transformSubmodule = new TransformSubmodule(trail);
|
|
|
|
return trail;
|
|
}
|
|
}
|
|
} |