Esempio n. 1
0
    void Start()
    {
        bool addEvents = false;

        foreach (Collider2D collider in anchorColliders)
        {
            addEvents = true;
        }

        if (addEvents == false)
        {
            return;
        }

        Destruction2D destruction = GetComponent <Destruction2D>();

        foreach (Collider2D collider in anchorColliders)
        {
            if (collider == null)
            {
                continue;
            }
            destruction.anchorPolygons.Add(Polygon2DList.CreateFromGameObject(collider.gameObject)[0]);
            destruction.anchorColliders.Add(collider);
        }

        Destruction2D destructionEvent = GetComponent <Destruction2D>();

        destructionEvent.AddAnchorEvent(AnchorEvent);
    }
Esempio n. 2
0
    void Start()
    {
        Destruction2D destruction = GetComponent <Destruction2D>();

        destruction.AddAnchorEvent(AnchorEvent);
    }