Public classes
|
Trivision
Main class of Trivision board. Board contains multiple rotating triangular prisms. Enums
Properties
Methods
Enums public enum Orientations Different orientations for prisms.
Properties public float GapBetweenPrisms Set or get size of gap between prisms, relative to prism size. 0 means no gap, 1 means same size gap as prisms themselves.
public bool GapsHidesImage Sets or gets whatever gaps between prisms hides parts of the image that would be in gaps. This have effect only if 'GapBetweenPrisms' is set to more than 0.
public float ObjectHeight Sets or gets desired height for whole board object. All prisms will be created to fit in this size.
public float ObjectWidth Sets or gets desired width for whole board object. All prisms will be created to fit in this size.
public Orientations Orientation Sets or gets orientation of prisms.
public int PrismCount Sets or gets number of prisms in board.
public float RandomMisalignment Sets or gets random misalignments of prisms. This can be added for extra realism so that all the prisms are not perfectly straight. 0 means no misalignments at all, 1 is maximum when all the prisms are slightly in wrong rotations.
Methods public Material GetBaseMaterial () Get current material used for prisms triangular bases.
public Material GetImageMaterial (int imageIndex) Get current image (material) used for certain side of prisms.
public TrivisionPrism GetPrism (int prismIndex) Get single prism from this Trivision board. This can be called only after this object Init() is called. Start() method will also call Init().
public TrivisionRunner GetRunner () Get TrivionRunner script attached to this GameObject. Trivision prefab have runner script attached to it, but if for some reason this GameObject doesn't have TrivionRunner component, one will be created and added to this GameObject, and then returned.
public void Init () This method will initialize the trivison board by creating prisms. This method is also called automatically by Unity's Start() method, so typically there is no need to call this method manually. public bool IsInitialized () Check if this trivision board is initialized. Before initialization it is possible to change Trivision properties. After initialization possible TrivisionRunner can be started and prisms can be accessed by using GetPrism() method.
public void SetBaseMaterial (Material baseMaterial) Set material used for prisms triangular bases. This can be changed also when application is running and after Trivision board is already created and initialized.
public void SetImageMaterial (int ïmageIndex, Material imageMaterial) Set image (material) used for certain side of prisms. This can be changed also when application is running and after Trivision board is already created and initialized.
public void ShowImageInstantly (int imageIndex) Instantly set rotation all the prisms so that certain image is facing front.
public void StartTransitionsToImage (int imageIndex, float prismsRotationTimeSeconds, TrivisionPrism.RotationStyle prismsRotationStyle) Start slow transition of all the prisms so that eventually certain image is facing front.
public void reCreateInEditMode () Method used only internally by custom inspector editor. |