private void SendLiquidContainer(LiquidContainer lc) { //find the color and split speed Color newColor = liquidContainer.LiquidColor; float ss = liquidContainer.GetSplitController.splitSpeed; //we find the coefficient of the volume of the tank and the volume of the incoming fluid float volume = lc.Volume; float koof = ss / (volume * 1000); lc.LiquidColor = Color.Lerp(lc.LiquidColor, newColor, koof * mixingSpeed); }
private void Awake() { liquidContainer = GetComponent <LiquidContainer>(); }