Example #1
0
 public void SetWorld(World world)
 {
     if (world is CameraWorld)
     {
         this.world = (CameraWorld)world;
     }
 }
Example #2
0
 protected void Start()
 {
     if (world == null)
     {
         world = WorldConsumerUtility.FindWorld <CameraWorld>(this);
     }
 }
Example #3
0
    GameObject TryGetClickObjByLayers(string[] layers, int rayLength = 10000)
    {
        RaycastHit hit;
        Ray        ray = CameraWorld.ScreenPointToRay(Input.mousePosition);

        for (int i = 0, length = layers.Length; i < length; ++i)
        {
            if (Physics.Raycast(ray, out hit, rayLength, 1 << LayerMask.NameToLayer(layers[i])))
            {
                return(hit.collider.gameObject);
            }
        }
        return(null);
    }