Exemplo n.º 1
0
    void OnSceneGUI()
    {
        Field_Of_View fow = (Field_Of_View)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(fow.transform.position, Vector3.forward, Vector3.up, 360, fow.viewRadius);

        Handles.color = Color.red;
        foreach (Transform visibleTarget in fow.visibleTargets)
        {
            Handles.DrawLine(fow.transform.position, visibleTarget.position);
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     if (!is_controlled)
     {
         GameObject this_fov = Instantiate(fov_prefab);
         this_fov.GetComponent <Field_Of_View>().target_transform = transform.parent;
         fov = this_fov.GetComponent <Field_Of_View>();
     }
     else
     {
         if (rotation_origin == null)
         {
             rotation_origin = this.transform;
         }
     }
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     fov = GetComponent <Field_Of_View>();
 }