LoadSample.cs 720 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using UnityEngine;
  3. namespace TriLib.Samples
  4. {
  5. public class LoadSample : MonoBehaviour
  6. {
  7. protected void Start()
  8. {
  9. using (AssetLoader assetLoader = new AssetLoader())
  10. {
  11. try
  12. {
  13. AssetLoaderOptions assetLoaderOptions = AssetLoaderOptions.CreateInstance();
  14. assetLoaderOptions.RotationAngles = new Vector3(90f, 180f, 0f);
  15. assetLoaderOptions.AutoPlayAnimations = true;
  16. GameObject gameObject = assetLoader.LoadFromFile(Application.dataPath + "/TriLib/TriLib/Samples/Models/Bouncing.fbx", assetLoaderOptions, null);
  17. gameObject.transform.position = new Vector3(128f, 0f, 0f);
  18. }
  19. catch (Exception ex)
  20. {
  21. Debug.LogError(ex.ToString());
  22. }
  23. }
  24. }
  25. }
  26. }