public void UpdateGlowerAccordingToGrowth()
{
if ((this.clusterPlantProps.hasStaticGlower == false)
&& (this.clusterPlantProps.hasDynamicGlower == false))
{
return;
}
// TODO: use flick component instead of spawning glower?
if (this.isInCryostasis
|| (this.Position.GetSnowDepth() >= this.def.hideAtSnowDepth))
{
TryToDestroyGlower();
return;
}
if (this.clusterPlantProps.hasStaticGlower)
{
if (this.glower.DestroyedOrNull())
{
this.glower = GenSpawn.Spawn(Util_CaveworldFlora.GetGlowerStaticDef(this.def), this.Position);
}
}
else if (this.clusterPlantProps.hasDynamicGlower)
{
if (this.Growth < 0.33f)
{
if ((this.glower.DestroyedOrNull())
|| (this.glower.def != Util_CaveworldFlora.GetGlowerSmallDef(this.def)))
{
TryToDestroyGlower();
this.glower = GenSpawn.Spawn(Util_CaveworldFlora.GetGlowerSmallDef(this.def), this.Position);
}
}
else if (this.Growth < 0.66f)
{
if ((this.glower.DestroyedOrNull())
|| (this.glower.def != Util_CaveworldFlora.GetGlowerMediumDef(this.def)))
{
TryToDestroyGlower();
this.glower = GenSpawn.Spawn(Util_CaveworldFlora.GetGlowerMediumDef(this.def), this.Position);
}
}
else
{
if ((this.glower.DestroyedOrNull())
|| (this.glower.def != Util_CaveworldFlora.GetGlowerBigDef(this.def)))
{
TryToDestroyGlower();
this.glower = GenSpawn.Spawn(Util_CaveworldFlora.GetGlowerBigDef(this.def), this.Position);
}
}
}
}