37. 問題5 答え
using UnityEngine;
public class Question5 : MonoBehaviour
{
public Vector3[] positions = new Vector3[]
{
new Vector3(0,0,0),
new Vector3(-5,0,0),
new Vector3(0,5,0),
new Vector3(0,0,5),
new Vector3(5,-5,5),
};
void OnDrawGizmos()
{
foreach (var position in positions)
{
Gizmos.DrawWireSphere(position, 0.5f);
}
}
}
using UnityEngine;
public class Question5 : MonoBehaviour
{
public Vector3[] positions = new Vector3[]
{
new Vector3(0,0,0),
new Vector3(-5,0,0),
new Vector3(0,5,0),
new Vector3(0,0,5),
new Vector3(5,-5,5),
};
}
using UnityEditor;
using UnityEngine;
public class Question5Editor
{
[DrawGizmo(GizmoType.Active)]
static void OnDrawGizmo(Question5 question5, GizmoType type)
{
foreach (Vector3 position in question5.positions)
{
Gizmos.DrawWireSphere(position, 0.5f);
}
}
}