Пример #1
0
    public void SetImage(Texture2D texture, string imageIdentifier, int textureIndex, bool animateOnSet)
    {
        m_imageSphereController.SetTextureInUse(m_nextTextureIndex, false); // Textures that were going to be used can be thrown away
        m_imageSphereController.SetTextureInUse(textureIndex, true);
        m_nextTextureIndex = textureIndex;

        m_imageIdentifier    = imageIdentifier;
        m_imageSphereTexture = texture;

        if (Debug.isDebugBuild)
        {
            Debug.Log("------- VREEL: Finished Loading Image from Texture2D, " +
                      " AnimateOnSet = " + animateOnSet +
                      " , ImageIdentifier = " + imageIdentifier +
                      " , PluginTextureIndex = " + textureIndex +
                      " , Texture size = " + m_imageSphereTexture.width + " x " + m_imageSphereTexture.height);
        }

        m_coroutineQueue.Clear();
        if (!animateOnSet)
        {
            UpdateTextureAndID();
        }
        else
        {
            m_coroutineQueue.EnqueueAction(AnimateSetTexture());
        }
    }
Пример #2
0
    public void SetImage(Texture2D texture, string imageIdentifier, int textureIndex)
    {
        if (imageIdentifier.Length <= 0)
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("------- VREEL: ERROR - attempting to set skybox to an empty filepath!");
            }
            return;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("------- VREEL: SetImage() got called with ImageIdentifier: " + imageIdentifier + ", and TextureIndex: " + textureIndex);
        }

        m_imageIdentifier = imageIdentifier;
        m_skyboxTexture   = texture;

        m_imageSphereController.SetTextureInUse(m_currTextureIndex, false);
        m_currTextureIndex = textureIndex;
        m_imageSphereController.SetTextureInUse(m_currTextureIndex, true);

        m_myMaterial.mainTexture = m_skyboxTexture;
        m_myMaterial.SetFloat("_FlipY", 1.0f); // This is only ever set to 0 on the default background image - should be 1 every time after...

        // TODO: have the skybox be used instead of just a sphere around the user?
        // RenderSettings.skybox = texture;
        if (Debug.isDebugBuild)
        {
            Debug.Log("------- VREEL: Changed skybox to = " + m_imageIdentifier + ", with TextureID = " + m_currTextureIndex);
        }
    }