public void EditorDirectionChange() { directional = GetComponent <Directional>(); spriteRendererLightOn = GetComponentsInChildren <SpriteRenderer>().Length > 1 ? GetComponentsInChildren <SpriteRenderer>()[1] : GetComponentsInChildren <SpriteRenderer>()[0]; var state = mountStatesMachine.LightMountStates[LightMountState.On]; spriteHandler.SetSpriteSO(state.SpriteData, null, SpritesDirectional.OrientationIndex(directional.CurrentDirection.AsEnum())); spriteRendererLightOn.sprite = spritesStateOnEffect.GetSpriteInDirection(directional.CurrentDirection.AsEnum()); RefreshBoxCollider(); }
private void SetSprites() { spriteHandler.SetSpriteSO(currentState.SpriteData, null, SpritesDirectional.OrientationIndex(directional.CurrentDirection.AsEnum())); spriteRendererLightOn.sprite = mState == LightMountState.On ? spritesStateOnEffect.GetSpriteInDirection(directional.CurrentDirection.AsEnum()) : null; itemInMount = currentState.Tube; var currentMultiplier = currentState.MultiplierIntegrity; if (currentMultiplier > 0.15f) { integrityThreshBar = integrity.initialIntegrity * currentMultiplier; } RefreshBoxCollider(); }
internal void ServerSetState(State state) { constructionState = state; switch (constructionState) { case State.initial: spriteHandler.SetSpriteSO(initialStateSprites, newVariantIndex: SpritesDirectional.OrientationIndex(directional.CurrentDirection.AsEnum())); break; case State.wiresAdded: lightSource.ServerChangeLightState(LightMountState.None); spriteHandler.SetSpriteSO(wiresAddedStateSprites, newVariantIndex: SpritesDirectional.OrientationIndex(directional.CurrentDirection.AsEnum())); break; case State.ready: default: lightSource.ServerChangeLightState(LightMountState.MissingBulb); break; } }