void SwitchRenderers(TRANSPARENCY_STATE newState) { Assert.AreEqual(TransparentRenderers.Length, TransparentRenderersStartingTransp.Length); for (int i = 0; i < TransparentRenderers.Length; i++) { Color oldColor = TransparentRenderers[i].material.color; oldColor.a = newState == TRANSPARENCY_STATE.SEMI_TRANSPARENT ? TransparentRenderersStartingTransp[i] : 0.0f; TransparentRenderers[i].material.color = oldColor; } }
void TransparencyClicked() { CurrentTransparencyState = (TRANSPARENCY_STATE)(((((int)CurrentTransparencyState) + 1)) % ((int)TRANSPARENCY_STATE.MAX_STATES)); SwitchRenderers(CurrentTransparencyState); }