Created
November 9, 2018 17:06
-
-
Save chittai/b8becd3e37bc1e6bf28f2d3350099bb7 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 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