Skip to content

Instantly share code, notes, and snippets.

@chittai
Created November 9, 2018 17:06
Show Gist options
  • Save chittai/b8becd3e37bc1e6bf28f2d3350099bb7 to your computer and use it in GitHub Desktop.
Save chittai/b8becd3e37bc1e6bf28f2d3350099bb7 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MakeLine : MonoBehaviour {
public GameObject startPoint;
public GameObject endPoint;
void Start () {
LineRenderer linerenderer = GetComponent<LineRenderer>();
linerenderer.startWidth = 0.01f;
linerenderer.endWidth = 0.01f;
linerenderer.positionCount = 2;
linerenderer.SetPosition(0, startPoint.transform.position);
linerenderer.SetPosition(1, endPoint.transform.position);
// 反映されなかった
linerenderer.startColor = Color.red;
linerenderer.endColor = Color.red;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment