Ejemplo n.º 1
0
    private void OnEnable()
    {
        roadCreator = (RoadCreator)target;
        roadCreator.Setup();
        roadCreator.aDown = false;
        roadCreator.pDown = false;
        roadCreator.sDown = false;
        roadCreator.dDown = false;

        lastTool      = Tools.current;
        Tools.current = Tool.None;

        Undo.undoRedoPerformed += UndoUpdate;
        Undo.undoRedoPerformed += roadCreator.UndoUpdate;

        if (roadCreator.startIntersection != null)
        {
            roadCreator.startIntersection.FixConnectionReferences();
        }

        if (roadCreator.endIntersection != null)
        {
            roadCreator.endIntersection.FixConnectionReferences();
        }
    }