void Start() { playerLight = GameObject.Find("PlayerLight").GetComponent <Light>(); Assert.IsNotNull(playerLight); creatureLight = GameObject.Find("CreatureLight").GetComponent <Light>(); Assert.IsNotNull(creatureLight); tileLight = GameObject.Find("TileLight").GetComponent <Light>(); Assert.IsNotNull(tileLight); pickupLight = GameObject.Find("PickupLight").GetComponent <Light>(); Assert.IsNotNull(pickupLight); decorationLight = GameObject.Find("DecorationLight").GetComponent <Light>(); Assert.IsNotNull(decorationLight); // cache & pause tweens. (playerAboveGroundTween = MFX.FadeIntensity(playerLight, playerAboveGround, fadeAfter, timeToFade)).Pause(); (creatureAboveGroundTween = MFX.FadeIntensity(creatureLight, creatureAboveGround, fadeAfter, timeToFade)).Pause(); (tileAboveGroundTween = MFX.FadeIntensity(tileLight, tileAboveGround, fadeAfter, timeToFade)).Pause(); (pickupAboveGroundTween = MFX.FadeIntensity(pickupLight, pickupAboveGround, fadeAfter, timeToFade)).Pause(); (decorationAboveGroundTween = MFX.FadeIntensity(decorationLight, pickupAboveGround, fadeAfter, timeToFade)).Pause(); (playerBelowGroundTween = MFX.FadeIntensity(playerLight, playerBelowGround, fadeAfter, timeToFade)).Pause(); (creatureBelowGroundTween = MFX.FadeIntensity(creatureLight, creatureBelowGround, fadeAfter, timeToFade)).Pause(); (tileBelowGroundTween = MFX.FadeIntensity(tileLight, tileBelowGround, fadeAfter, timeToFade)).Pause(); (pickupBelowGroundTween = MFX.FadeIntensity(pickupLight, pickupBelowGround, fadeAfter, timeToFade)).Pause(); (decorationBelowGroundTween = MFX.FadeIntensity(decorationLight, pickupBelowGround, fadeAfter, timeToFade)).Pause(); }
void OnPlayerAboveGround(bool aboveGround) { if (aboveGround) { MFX.FadeIntensity(playerLight, playerAboveGround, fadeAfter, timeToFade); MFX.FadeIntensity(creatureLight, creatureAboveGround, fadeAfter, timeToFade); MFX.FadeIntensity(tileLight, tileAboveGround, fadeAfter, timeToFade); MFX.FadeIntensity(pickupLight, pickupAboveGround, fadeAfter, timeToFade); } else { MFX.FadeIntensity(playerLight, playerBelowGround, fadeAfter, timeToFade); MFX.FadeIntensity(creatureLight, creatureBelowGround, fadeAfter, timeToFade); MFX.FadeIntensity(tileLight, tileBelowGround, fadeAfter, timeToFade); MFX.FadeIntensity(pickupLight, pickupBelowGround, fadeAfter, timeToFade); } }