Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     // To avoid eventual issues with incorrect water level :
     if (CurrentWaterLevel < 0.0f)
     {
         CurrentWaterLevel = 0.0f;
     }
     if (CurrentWaterLevel > 1.0f)
     {
         CurrentWaterLevel = 1.0f;
     }
     // Update the water level
     if (_modified)
     {
         _water.ChangeLevel(CurrentWaterLevel);
         _modified = false;
     }
 }