- Home /
Question by
umurcg · Jan 31, 2016 at 10:19 PM ·
editorhandlespathfollowing
How can I make hadles lines visible all the time?
Hi, I am trying to make a basic motion system for my game. And I want to see paths in editor.
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(freeCamera))]
public class LineInspector : Editor {
void OnSceneGUI(){
freeCamera fc = target as freeCamera;
Handles.color = Color.blue;
for (int i = 0; i < fc.transform.childCount-1; i++) {
GameObject obj=fc.transform.GetChild(i).gameObject;
Handles.DrawLine (fc.transform.GetChild (i).position, fc.transform.GetChild (i + 1).position);
Handles.ArrowCap (i, fc.transform.GetChild (i).position, fc.transform.GetChild (i).rotation, 5f);
}
Handles.ArrowCap (fc.transform.childCount-1, fc.transform.GetChild (fc.transform.childCount-1).position, fc.transform.GetChild (fc.transform.childCount-1).rotation, 5f);
}
}
I can see path only when I click object that having "freeCamera" class. How can I make this path visible globally. In other words it must be visible all the time regardless which game object I clicked.
Thank you.
Comment
Your answer
Follow this Question
Related Questions
Handles.matrix seems strange? 2 Answers
Editor Handles Vertex Snap not working on script's object. 0 Answers
Draw ellipse via Handles class 0 Answers
Keep multiple custom handles visible in the Scene view 0 Answers