// void Awake() { switch (normal) { case Normal.Forward: GetNormal = GetNormalForward; break; case Normal.Right: GetNormal = GetNormalRight; break; case Normal.Up: GetNormal = GetNormalUp; break; case Normal.Follow2D: GetNormal = GetNormalFollow2D; break; } savePos = transform.position; saveNorm = GetNormal(); autoDestroyCounter = Time.time + (maxLines * secondsPerLine) + 0.1f; CreateMesh(); }
void OnValidate() { if (maxLines < 1) maxLines = 1; if (secondsPerLine < 0.0f) secondsPerLine = 0.0f; switch (normal) { case Normal.Forward: GetNormal = GetNormalForward; break; case Normal.Right: GetNormal = GetNormalRight; break; case Normal.Up: GetNormal = GetNormalUp; break; case Normal.Follow2D: GetNormal = GetNormalFollow2D; break; } }