Exemplo n.º 1
0
    private void Start()
    {
        if (m_Waypoint != null)
        {
            return;
        }

        if (m_Waypoint == null)
        {
            m_Waypoint = FindObjectOfType <WaypointCreater>();
            if (m_Waypoint == null)
            {
                throw new MissingReferenceException("Missing reference of WaypointCreater script.");
            }
        }
    }
Exemplo n.º 2
0
    private void OnEnable()
    {
        m_LastTool    = Tools.current;
        Tools.current = Tool.None;

        m_WaypointCreater = (WaypointCreater)target;

        m_SerializedObject = serializedObject;
        m_PropPointRadius  = m_SerializedObject.FindProperty("WaypointRadius");
        m_PropColor        = m_SerializedObject.FindProperty("PointColor");
        m_PropWaypoints    = m_SerializedObject.FindProperty("Waypoints");
        m_PropCheckBoxs    = m_SerializedObject.FindProperty("WaypointsCheckBox");
        m_PropGroundLevel  = m_SerializedObject.FindProperty("MinGroundLevel");
        m_PropIsSetGround  = m_SerializedObject.FindProperty("IsSetGroundLevel");
        m_PropInsertPoint  = m_SerializedObject.FindProperty("IsInsertPoint");

        Selection.selectionChanged += Repaint;
        SceneView.duringSceneGui   += DuringSceneGUI;
    }