Пример #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);
        }
    }
Пример #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);
        }
    }
Пример #3
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        slicer.AddEvent(OnSlice);
        slicer.AddResultEvent(AfterSlice);
    }
Пример #4
0
    void Awake()
    {
        Slicer2D slicer = GetComponent <Slicer2D> ();

        slicer.AddResultEvent(OnSliceResult);

        polygon = Polygon.CreateFromCollider(connector);
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        if (slicer != null)
        {
            slicer.AddResultEvent(SliceEvent);
        }
    }
Пример #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();
        }
    }
Пример #8
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

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

        posZ = transform.position.z - 0.1f;
    }
Пример #9
0
    void Start()
    {
        if (anchorCollider == null)
        {
            return;
        }

        Slicer2D slicer = GetComponent <Slicer2D> ();

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

        polygon = Polygon.CreateFromCollider(anchorCollider.gameObject);
    }
Пример #10
0
    void Start()
    {
        Slicer2D slicer = GetComponent <Slicer2D>();

        slicer.AddResultEvent(SliceEvent);
    }