Created
June 27, 2017 00:15
-
-
Save flushpot1125/81a778f1e4c853ea1284678717bd349d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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