Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        WaveTransform     = GameObject.FindGameObjectWithTag("Boat").GetComponent <waterBoat>();
        BoatStartPosition = WaveTransform.transform.position;
        speed             = WaveTransform.MaxSpeed;
        //Mesh Setup
        Mesh      = new Mesh();
        Mesh.name = gameObject.name;

        Mesh.vertices  = GenerateVerts();
        Mesh.triangles = GenerateTries();
        Mesh.uv        = GenerateUVs();
        Mesh.RecalculateBounds();
        Mesh.RecalculateNormals();

        MeshFilter      = gameObject.AddComponent <MeshFilter>();
        MeshFilter.mesh = Mesh;
    }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     Boatdata = GameObject.FindGameObjectWithTag("Boat").GetComponent <waterBoat>();
     speed    = Boatdata.MaxSpeed;
 }