기술 자료

Unity Engine

Unity Engine

SetColors(Color, Color)

Set the line color at the start and at the end.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
경고
Deprecated. Use startColor, endColor or colorGradient instead.
public void SetColors(Color start, Color end)

Parameters

start


Examples

using UnityEngine;public class Example : MonoBehaviour{ // Adds a lineRenderer to this transform and // makes the line renderer fade at the end. Color c1 = Color.white; Color c2 = new Color(1, 1, 1, 0); void Start() { LineRenderer lineRenderer = gameObject.AddComponent<LineRenderer>(); lineRenderer.material = new Material(Shader.Find("Sprites/Default")); lineRenderer.SetColors(c1, c2); }}