1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace Status
- {
- /// <summary>
- /// DetailsLevel manages and changes the current details level
- /// </summary>
- public class DetailsLevel : MonoBehaviour
- {
- /// <summary>
- /// Currently active details level
- /// State == 0 LOD Group handles model
- /// State == 1 blocks only
- /// State == 2 models without color
- /// State == 3 models with color and full detail
- /// </summary>
- public static int State = 0;
- /// <summary>
- /// Maximum number of states
- /// </summary>
- private readonly static int NumberOfMStates = 4;
- // Update is called once per frame
- void Update()
- {
- // Change current state via button press
- if (Input.GetButtonDown("Change"))
- {
- CycleStates(1);
- }
-
- }
- public void CycleStates(short direction)
- {
- State = (State + (int)Mathf.Sign(direction)) % (NumberOfMStates);
- }
- }
- }
|