void Start()
        {
            // hide mouse cursor
            //Cursor.visible = false;

            // by default set the main-camera to be screen-camera
            if (screenCamera == null)
            {
                screenCamera = Camera.main;
            }

            // calculate max slides and textures
            //maxSides = cubeSides.Count;
            maxTextures = slideTextures.Count;

            initialRotation = screenCamera ? Quaternion.Inverse(screenCamera.transform.rotation) * transform.rotation : transform.rotation;
            isSpinning      = false;

            tex  = 0;
            side = hsides[1];

            if (side < cubeSides.Count && cubeSides[side] && cubeSides[side].GetComponent <Renderer>())
            {
                cubeSides[side].GetComponent <Renderer>().material.mainTexture = slideTextures[tex];
                //cubeSides[side].GetComponent<Renderer>().material.SetTexture("_BaseMap", slideTextures[tex]);  // URP
            }

            // get the gestures listener
            gestureListener = CubeGestureListener.Instance;
        }
示例#2
0
 void Awake()
 {
     instance = this;
 }