Inheritance: e2dTerrainMesh
Exemplo n.º 1
0
    /// Called when the the editor reloads the script or when the action starts.
    void OnEnable()
    {
        EditorReference = null;

        mBoundary     = new e2dTerrainBoundary(this);
        mFillMesh     = new e2dTerrainFillMesh(this);
        mCurveMesh    = new e2dTerrainCurveMesh(this);
        mGrassMesh    = new e2dTerrainGrassMesh(this);
        mColliderMesh = new e2dTerrainColliderMesh(this);

        if (!mFillMesh.IsMeshValid() || (e2dUtils.DEBUG_REBUILD_ON_ENABLE && !Application.isPlaying))
        {
            FixCurve();
            FixBoundary();
            RebuildAllMaterials();
            RebuildAllMeshes();
        }
        else
        {
            // make sure the curve control textures are ready
            CurveMesh.UpdateControlTextures(true);
        }
    }
Exemplo n.º 2
0
    /// Called when the the editor reloads the script or when the action starts.
    void OnEnable()
    {
        EditorReference = null;

        mBoundary = new e2dTerrainBoundary(this);
        mFillMesh = new e2dTerrainFillMesh(this);
        mCurveMesh = new e2dTerrainCurveMesh(this);
        mGrassMesh = new e2dTerrainGrassMesh(this);
        mColliderMesh = new e2dTerrainColliderMesh(this);

        if (!mFillMesh.IsMeshValid() || (e2dUtils.DEBUG_REBUILD_ON_ENABLE && !Application.isPlaying))
        {
            FixCurve();
            FixBoundary();
            RebuildAllMaterials();
            RebuildAllMeshes();
        }
        else
        {
            // make sure the curve control textures are ready
            CurveMesh.UpdateControlTextures(true);
        }
    }