public virtual TBuilder TakeDefault(LiquidBase liquidBase) { Name = liquidBase.Name; ByteImage = liquidBase.ByteImage; return(BuilderInstance); }
// Spawn a new droplet of the requested color, in the requested position public void Drop(LiquidBase color, Vector3 worldPos) { Droplet newDroplet = Instantiate(dropletTemplate); newDroplet.name = "Droplet"; newDroplet.transform.position = worldPos; newDroplet.color = color; newDroplet.gameObject.SetActive(true); }
public static Color BaseToColor(LiquidBase inColor) { if (inColor == LiquidBase.Blue) { return(Color.blue); } else if (inColor == LiquidBase.Green) { return(Color.green); } else { return(Color.red); } }
// Add in new color to he liquid basin public void Add(LiquidBase liquidBase) { if (GameManager.instance.WinState || GameManager.instance.FailState) { return; } // Increase water level 5% per drop. Adjustment made in Update(). targetY += .05f; // Log new color contribution. Also applied in Update(). if (liquidBase == LiquidBase.Blue) { blueCount++; } else if (liquidBase == LiquidBase.Green) { greenCount++; } else { redCount++; } }