Ejemplo n.º 1
0
    private void MoveCorner(int corner, Vector2 offset)
    {
        switch (corner)
        {
        case 0:
            keystone.TopLeftOffset += offset;
            plane.topLeftOffset    += offset;
            break;

        case 1:
            keystone.TopRightOffset += offset;
            plane.topRightOffset    += offset;
            break;

        case 2:
            keystone.BottomLeftOffset += offset;
            plane.bottomLeftOffset    += offset;
            break;

        case 3:
            keystone.BottomRightOffset += offset;
            plane.bottomRightOffset    += offset;
            break;

        default:
            Debug.LogError("Invalid KeystoneCorner specified");
            break;
        }
        plane.Rebuild();
    }
Ejemplo n.º 2
0
    static void Create()
    {
        GameObject      gameObject = new GameObject("ProceduralPlane");
        ProceduralPlane c          = gameObject.AddComponent <ProceduralPlane>();
        MeshFilter      meshFilter = gameObject.GetComponent <MeshFilter>();

        meshFilter.mesh = new Mesh();
        c.Rebuild();
        c.AssignDefaultShader();
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        plane = this.gameObject.GetComponent <ProceduralPlane>();
        //keystone = new KeystoneOffset(); // LOAD
        keystone = KeystoneOffset.Load();

        // apply stored (serialized) offsets
        plane.topLeftOffset     = keystone.TopLeftOffset;
        plane.topRightOffset    = keystone.TopRightOffset;
        plane.bottomLeftOffset  = keystone.BottomLeftOffset;
        plane.bottomRightOffset = keystone.BottomRightOffset;
        plane.Rebuild();
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        plane = this.gameObject.GetComponent<ProceduralPlane>();
        //keystone = new KeystoneOffset(); // LOAD
        keystone = KeystoneOffset.Load();

        // apply stored (serialized) offsets
        plane.topLeftOffset = keystone.TopLeftOffset;
        plane.topRightOffset = keystone.TopRightOffset;
        plane.bottomLeftOffset = keystone.BottomLeftOffset;
        plane.bottomRightOffset = keystone.BottomRightOffset;
        plane.Rebuild();
    }