TrivisionRunner
Derived from
MonoBehaviour
Class to run trivision board automatically. By default, this script is attached to Trivision prefab and can be get by calling GetRunner() of main Trivision class.
Enums
public enum DelayedRotations | Different delays in rotations that can be used for simple effects. | public enum Sequences | Different sequences how images are changed. | public enum State | List of different possible states of this instance. |
Properties
public bool AutoStart | Sets or gets automatic start value. | public DelayedRotations DelayedRotation | Sets or gets the setting for delayed rotations. | public float DelayedRotationAmount | Sets or gets strength of delayed rotations effect. | public float FirstImageShowSeconds | Sets or gets how long time first image will stay visible before next transition starts. | public TrivisionPrism.RotationStyle RotationStyle | Sets or gets the rotation style used when single prism rotates. | public float RotationTimeSeconds | Sets or gets time how long single prism rotation takes. | public bool RunInEditor | Property used only internally by custom inspector editor. | public float SecondImageShowSeconds | Sets or gets how long time second image will stay visible before next transition starts. | public Sequences Sequence | Sets or gets the sequence used. | public float ThirdImageShowSeconds | Sets or gets how long time third image will stay visible before next transition starts. |
Methods
Enums
public enum DelayedRotations Different delays in rotations that can be used for simple effects. Items | None | No delays, all the prisms start rotating at the same time. | | Wave | Topmost/leftmost prisms start rotating first and all the others follow with delay. | | ReversedWave | Bottommost/rightmost prisms start rotating first and all the others follow with delay. | | Random | All the prisms start rotating with random delay. With long delays this may look chaotic. |
public enum Sequences Different sequences how images are changed. Items | Normal | Normal sequence: 1, 2, 3, 1... | | PingPong | Ping-pong sequence: 1, 2, 3, 2, 1... Middle image will appear twice as much as others | | Reversed | Reversed sequence: 3, 2, 1, 3... Difference compared for just setting images 1 and 3 to different slots is that with this sequence prisms are rotating to other direction | | Random | Random sequence. |
public enum State List of different possible states of this instance. Items | Init | Instance is still initializing. This state will change if ResetRunner() or StartRunner() is called, or in next update loop if 'AutoStart' is enabled. | | NotRunning | Instance is ready but currently not running, either just created without 'AutoStart' disabled, or StopRunner() have been called. | | ShowingImage | Running normally and currently showing one of the three images. | | InTransition | Running normally and currently in transition between two images. | | Error | Internal error have occurred. This should not happen, but if it does, there's error log in console. |
Properties
public bool AutoStart Sets or gets automatic start value. Value | If true, this runner will start automatically when application starts and Trivision board is created. If false, StartRunner() method have to be called to start. |
public DelayedRotations DelayedRotation Sets or gets the setting for delayed rotations. Value | One of the values from enum DelayedRotations. |
public float DelayedRotationAmount Sets or gets strength of delayed rotations effect. With value 0 everything looks same as if 'DelayedRotations' would have been set to 'None'. With value 1 last prisms start rotating only after first ones have already finished rotating. Value | Delayed rotation effect percent. |
public float FirstImageShowSeconds Sets or gets how long time first image will stay visible before next transition starts.
public TrivisionPrism.RotationStyle RotationStyle Sets or gets the rotation style used when single prism rotates. Value | One of the values from enum TrivisionPrism.RotationStyle. |
public float RotationTimeSeconds Sets or gets time how long single prism rotation takes.
public bool RunInEditor Property used only internally by custom inspector editor.
public float SecondImageShowSeconds Sets or gets how long time second image will stay visible before next transition starts.
public Sequences Sequence Sets or gets the sequence used. Value | One of the values from enum Sequences. |
public float ThirdImageShowSeconds Sets or gets how long time third image will stay visible before next transition starts.
Methods
public int GetCurrentShowingImage () Get image that is currently being displayed. This is index between 0 and 2. Returns | Image being currently displayed, -1 if runner is not yet initalized or error have occurred. |
public State GetState () Get state of this instance. Returns | One of the values from enum State. |
public void NextTransition () Manually run next image transition based on set sequence.
public void ResetRunner () This will set runner to initial, non-running state. Trivision board will be set to display first image.
public void StartRunner () This will start runner, or continue after StopRunner() is called.
public void StopRunner () This will stop runner. Note that if this is called during transition, prisms will still rotate to their new position.
public void editorUpdate (float deltaTime) Method used only internally by custom inspector editor.
|