// Use this for initialization void Start() { boatRB = gameObject.GetComponent <Rigidbody>(); modifyBoatMesh = new ModifyBoatMesh(gameObject); underWaterMesh = underWaterObj.GetComponent <MeshFilter>().mesh; }
void Start() { //Init the script that will modify the boat mesh modifyBoatMesh = new ModifyBoatMesh(boatMeshObj, underWaterObj, aboveWaterObj, boatRB); //Meshes that are below and above the water underWaterMesh = underWaterObj.GetComponent <MeshFilter>().mesh; aboveWaterMesh = aboveWaterObj.GetComponent <MeshFilter>().mesh; }
void Start() { //Get the boat's rigidbody boatRB = gameObject.GetComponent <Rigidbody>(); //Init the script that will modify the boat mesh modifyBoatMesh = new ModifyBoatMesh(gameObject); //Meshes that are below and above the water underWaterMesh = underWaterObj.GetComponent <MeshFilter>().mesh; }