Exemple #1
0
        private void InitializeCompositeCollider()
        {
            compositeColliders.Clear();

            CompositeCollider2D compositeCollider2D = gameObject.GetComponent <CompositeCollider2D>();

            if (compositeCollider2D != null)
            {
                compositeColliders = Polygon2Collider2D.CreateFromCompositeCollider(compositeCollider2D);
            }
        }
Exemple #2
0
        public override List <Polygon2> GetPolygonsLocal()
        {
            if (LocalPolygons != null)
            {
                return(LocalPolygons);
            }

            CompositeCollider2D compositeCollider = GetCompositeCollider();

            LocalPolygons = Polygon2Collider2D.CreateFromCompositeCollider(compositeCollider);

            if (LocalPolygons.Count <= 0)
            {
                Debug.LogWarning("SmartLighting2D: LightingCollider2D object is missing CompositeCollider2D Component", transform.gameObject);
            }

            return(LocalPolygons);
        }