public static Color color ;

描述

为接下来绘制的辅助图标设置颜色。

任何颜色都可以应用于辅助图标。以下示例显示了使用红色 color 的情况。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnDrawGizmosSelected() { // Draws a 5 unit long red line in front of the object Gizmos.color = Color.red; Vector3 direction = transform.TransformDirection(Vector3.forward) * 5; Gizmos.DrawRay(transform.position, direction); } }