/// <summary>
        /// Unity callback that is invoked before the first frame update.
        /// </summary>
        void Start()
        {
            Gui.Instance.DefaultFooterMessage
                = "drag .glb/.zip onto window to view";
            Gui.Instance.ResetFooterMessage();

            // run javascript startup tasks (e.g. register event
            // handlers for drag-and-drop)
            JsLib.Init();

            // Set up callbacks for logging progress messages during
            // glTF imports.
            //
            // On the WebGL platform, progress messages are rendered as HTML
            // as part of the containing web page (outside of the Unity WebGL canvas),
            // whereas on Windows/Android the progress messages are rendered
            // directly on top of the view using IMGUI methods.
            ProgressLog.Instance.AddLineCallback    = JsLib.AddProgressLogLine;
            ProgressLog.Instance.UpdateLineCallback = JsLib.UpdateProgressLogLine;
            ProgressLog.Instance.ResetLogCallback   = JsLib.ResetProgressLog;

            // Set max bone weights per vertex to 4 (default is 2).
            // This prevents skinned glTF models that use more than 2
            // bone weights per vertex from exploding.

#if UNITY_2019_2_OR_NEWER
            QualitySettings.skinWeights = SkinWeights.FourBones;
#else
            QualitySettings.blendWeights = BlendWeights.FourBones;
#endif
        }
예제 #2
0
        /// <summary>
        /// Unity callback that is invoked before the first frame update.
        /// </summary>
        void Start()
        {
            Gui.Instance.DefaultFooterMessage
                = "drag .glb/.zip onto window to view";
            Gui.Instance.ResetFooterMessage();

            // run javascript startup tasks (e.g. register event
            // handlers for drag-and-drop)
            JsLib.Init();

            // Set up callbacks for logging progress messages during
            // glTF imports.
            //
            // On the WebGL platform, progress messages are rendered as HTML
            // as part of the containing web page (outside of the Unity WebGL canvas),
            // whereas on Windows/Android the progress messages are rendered
            // directly on top of the view using IMGUI methods.
            ProgressLog.Instance.AddLineCallback    = JsLib.AddProgressLogLine;
            ProgressLog.Instance.UpdateLineCallback = JsLib.UpdateProgressLogLine;
            ProgressLog.Instance.ResetLogCallback   = JsLib.ResetProgressLog;

            // load default model (Piglet mascot)
            GameManager.Instance.StartImport(Path.Combine(
                                                 Application.streamingAssetsPath, "piggleston.glb"));
        }