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

        foreach (Collider2D collider in anchorsList)
        {
            if (collider != null)
            {
                addEvents = true;
            }
        }

        if (addEvents == false)
        {
            return;
        }

        Slicer2D slicer = GetComponent <Slicer2D> ();

        if (slicer != null)
        {
            slicer.AddResultEvent(OnAnchorSliceResult);
            slicer.AddEvent(OnAnchorSlice);
        }

        foreach (Collider2D collider in anchorsList)
        {
            anchorPolygons.Add(Polygon2DList.CreateFromGameObject(collider.gameObject)[0]);
            anchorColliders.Add(collider);
        }
    }
Esempio n. 2
0
    void Start()
    {
        bool addEvents = false;

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

        if (addEvents == false)
        {
            return;
        }

        Slicer2D slicer = GetComponent <Slicer2D> ();

        if (slicer != null)
        {
            slicer.AddResultEvent(OnSliceResult);
            slicer.AddEvent(OnSlice);
        }

        foreach (Collider2D collider in anchorColliders)
        {
            polygons.Add(Polygon2D.CreateFromCollider(collider.gameObject));
            colliders.Add(collider);
        }
    }
Esempio n. 3
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        slicer.AddEvent(OnSlice);
        slicer.AddResultEvent(AfterSlice);
    }
Esempio n. 4
0
    void Awake()
    {
        Slicer2D slicer = GetComponent <Slicer2D> ();

        slicer.AddResultEvent(OnSliceResult);

        polygon = Polygon.CreateFromCollider(connector);
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        if (slicer != null)
        {
            slicer.AddResultEvent(SliceEvent);
        }
    }
Esempio n. 6
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D> ();

        slicer.AddResultEvent(OnSlice);

        body2D = GetComponent <Rigidbody2D> ();

        GetJoint();
    }
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        slicer.AddResultEvent(SlicerEvent);

        if (timer == null)
        {
            timer = TimerHelper.Create();
        }
    }
Esempio n. 8
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        if (slicer != null)
        {
            slicer.AddResultEvent(SliceEvent);
        }

        posZ = transform.position.z - 0.1f;
    }
    void Start()
    {
        if (anchorCollider == null)
        {
            return;
        }

        Slicer2D slicer = GetComponent <Slicer2D> ();

        if (slicer != null)
        {
            slicer.AddResultEvent(OnSliceResult);
            slicer.AddEvent(OnSlice);
        }

        polygon = Polygon.CreateFromCollider(anchorCollider.gameObject);
    }
Esempio n. 10
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        slicer.AddResultEvent(SliceEvent);
    }