Esempio n. 1
0
        void UpdateValues(movement_manager ship)
        {
            BoxCollider collider    = ship.GetComponentInChildren <BoxCollider>();
            Vector2     min_extents = new Vector2(collider.bounds.min.x, collider.bounds.min.y);
            Vector2     max_extents = new Vector2(collider.bounds.max.x, collider.bounds.max.y);

            min_left_position   = Camera.main.WorldToScreenPoint(new Vector3(min_extents.x, 0, collider.bounds.center.y)).x;
            max_right_position  = Camera.main.WorldToScreenPoint(new Vector3(max_extents.x, 0, collider.bounds.center.y)).x;
            min_bottom_position = Camera.main.WorldToScreenPoint(new Vector3(collider.bounds.center.y, 0, min_extents.y)).z;
            max_top_position    = Camera.main.WorldToScreenPoint(new Vector3(collider.bounds.center.y, 0, max_extents.y)).z;
        }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     this_movement_manager = GetComponent <movement_manager>();
 }