Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LineRendererTest1-1 : MonoBehaviour {
private LineRenderer lr;
private Renderer rn;
// Use this for initialization
void Start () {
lr = GetComponent<LineRenderer>();
lr.SetVertexCount(4);
lr.SetWidth(0.2f,0.2f);
AnimationCurve curve = new AnimationCurve();
curve.AddKey(0.0f, 0.2f);
curve.AddKey(0.2f, 0.2f);
lr.widthCurve = curve;
lr.SetPosition(0,new Vector3(-7.0f,-2.0f,25.0f));
lr.SetPosition(1,new Vector3(14.0f,-2.0f,25.0f));
lr.SetPosition(2,new Vector3(-7.0f,-2.0f,25.0f));
lr.SetPosition(3, new Vector3(-7.0f,15.0f,25.0f));
rn = GetComponent<Renderer>();
//rn.material.SetColor("_Color",new Color(246,255,0,255));
rn.material.SetColor("_Color",new Color(0.5f,0.7f,1.0f,1));
}
// Update is called once per frame
void Update () {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment