StartEditing() private method

private StartEditing ( Collider2D collider ) : void
collider UnityEngine.Collider2D
return void
Esempio n. 1
0
        public void StartEditing(Collider2D collider)
        {
            Undo.undoRedoPerformed += UndoRedoPerformed;

            Reset();

            PolygonCollider2D polygon = collider as PolygonCollider2D;

            if (polygon)
            {
                m_ActiveCollider  = collider;
                m_LoopingCollider = true;
                m_MinPathPoints   = 3;
                PolygonEditor.StartEditing(polygon);
                return;
            }

            EdgeCollider2D edge = collider as EdgeCollider2D;

            if (edge)
            {
                m_ActiveCollider  = collider;
                m_LoopingCollider = false;
                m_MinPathPoints   = 2;
                PolygonEditor.StartEditing(edge);
                return;
            }

            throw new NotImplementedException(string.Format("PolygonEditorUtility does not support {0}", collider));
        }
        public void StartEditing(Collider2D collider)
        {
            Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
            this.Reset();
            PolygonCollider2D colliderd = collider as PolygonCollider2D;

            if (colliderd != null)
            {
                this.m_ActiveCollider  = collider;
                this.m_LoopingCollider = true;
                this.m_MinPathPoints   = 3;
                PolygonEditor.StartEditing(colliderd);
            }
            else
            {
                EdgeCollider2D colliderd2 = collider as EdgeCollider2D;
                if (colliderd2 == null)
                {
                    throw new NotImplementedException(string.Format("PolygonEditorUtility does not support {0}", collider));
                }
                this.m_ActiveCollider  = collider;
                this.m_LoopingCollider = false;
                this.m_MinPathPoints   = 2;
                PolygonEditor.StartEditing(colliderd2);
            }
        }
        public void StartEditing(Collider2D collider)
        {
            Undo.undoRedoPerformed += new Undo.UndoRedoCallback(this.UndoRedoPerformed);
            this.Reset();
            PolygonCollider2D polygonCollider2D = collider as PolygonCollider2D;

            if ((bool)((UnityEngine.Object)polygonCollider2D))
            {
                this.m_ActiveCollider  = collider;
                this.m_LoopingCollider = true;
                this.m_MinPathPoints   = 3;
                PolygonEditor.StartEditing((Collider2D)polygonCollider2D);
            }
            else
            {
                EdgeCollider2D edgeCollider2D = collider as EdgeCollider2D;
                if (!(bool)((UnityEngine.Object)edgeCollider2D))
                {
                    throw new NotImplementedException(string.Format("PolygonEditorUtility does not support {0}", (object)collider));
                }
                this.m_ActiveCollider  = collider;
                this.m_LoopingCollider = false;
                this.m_MinPathPoints   = 2;
                PolygonEditor.StartEditing((Collider2D)edgeCollider2D);
            }
        }