Example #1
0
        //
        // Technically, this entire example could be written in either Awake() or Start(), but Awake is
        // used here to emphasize the one-time-only initialization from the work that could
        // potentially be executed at run-time.
        //

        void Awake()
        {
            // Init USD.
            InitUsd.Initialize();

            // In this example, we assume there is a set of well known shaders, we will look up the
            // material based on the associated ID. This map allows the identifier in USD to differ from
            // the identifier specified in the Unity shader.
            m_shaderMap = new Dictionary <string, ShaderPair>();

            // Setup the Standard shader USD <-> Unity mapping.
            m_shaderMap.Add("Unity.Standard",
                            new ShaderPair(UnityEngine.Shader.Find("Standard"), new StandardShaderSample()));
        }
        // ------------------------------------------------------------------------------------------ //
        // Unity Behavior Events.
        // ------------------------------------------------------------------------------------------ //

        void Awake()
        {
            // Init USD.
            InitUsd.Initialize();
        }
 void Start()
 {
     InitUsd.Initialize();
 }