public int GetSortingLayer() { LightShape.Base shadowShape = GetShadowShape(); if (shadowShape != null) { int shadowLayer = shadowShape.GetSortingLayer(); if (shadowLayer != 0) { return(shadowLayer); } } LightShape.Base maskShape = GetMaskShape(); if (maskShape != null) { int maskLayer = maskShape.GetSortingLayer(); if (maskLayer != 0) { return(maskLayer); } } return(0); }
public bool RectOverlap(Rect rect) { LightShape.Base shadowShape = GetShadowShape(); LightShape.Base maskShape = GetMaskShape(); if (maskShape != null && shadowShape != null) { if (maskShape == shadowShape) { return(shadowShape.GetWorldRect().Overlaps(rect)); } } if (shadowShape != null) { bool result = shadowShape.GetWorldRect().Overlaps(rect); if (result) { return(true); } } if (maskShape != null) { bool result = maskShape.GetWorldRect().Overlaps(rect); if (result) { return(true); } } return(false); }
public List <Polygon2> GetPolygonsWorld() { LightShape.Base shadowShape = GetShadowShape(); if (shadowShape != null) { return(shadowShape.GetPolygonsWorld()); } return(null); }
public List <MeshObject> GetMeshes() { LightShape.Base maskShape = GetMaskShape(); if (maskShape != null) { return(maskShape.GetMeshes()); } return(null); }
public void ResetWorld() { LightShape.Base shadowShape = GetShadowShape(); if (shadowShape != null) { shadowShape.ResetWorld(); } LightShape.Base maskShape = GetMaskShape(); if (maskShape != null) { maskShape.ResetWorld(); } }
public Rect GetIsoWorldRect() { LightShape.Base shadowShape = GetShadowShape(); if (shadowShape != null) { return(shadowShape.GetIsoWorldRect()); } LightShape.Base maskShape = GetMaskShape(); if (maskShape != null) { return(maskShape.GetIsoWorldRect()); } return(new Rect()); }
public Vector2 GetPivotPoint() { LightShape.Base shadowShape = GetShadowShape(); if (shadowShape != null) { switch (maskPivot) { case LightCollider2D.MaskPivot.TransformCenter: return(shadowShape.GetPivotPoint_TransformCenter()); case LightCollider2D.MaskPivot.ShapeCenter: return(shadowShape.GetPivotPoint_ShapeCenter()); case LightCollider2D.MaskPivot.LowestY: return(shadowShape.GetPivotPoint_LowestY()); } } return(Vector2.zero); }