void Awake() { if (Application.platform == RuntimePlatform.WindowsPlayer) { tmpFilePath = Application.dataPath + "/../tmp/"; externalFilePath = Application.dataPath + "/../Plugins/Windows/"; sampleMotionDirPath = Application.dataPath + "/../Plugins/SampleMotion/"; } else if (Application.platform == RuntimePlatform.OSXPlayer) { tmpFilePath = Application.dataPath + "/../../tmp/"; externalFilePath = Application.dataPath + "/../../Plugins/OSX/"; sampleMotionDirPath = Application.dataPath + "/../../Plugins/SampleMotion/"; } else { tmpFilePath = Application.dataPath + "/tmp/"; externalFilePath = Application.dataPath + "/Plugins/"; sampleMotionDirPath = Application.dataPath + "/Plugins/SampleMotion/"; } if (PlenAnimation != null) { PlenAnimation.Initialize(this); PlenAnimation.AnimationStarted += (_) => { IsAnimationPlaying = true; }; PlenAnimation.AnimationEnded += (_) => { IsAnimationPlaying = false; }; } if (PanelFrames != null) { PanelFrames.Initialize(this); } if (MotionData != null) { MotionData.Initialize(this); } if (ModelViewController != null) { ModelViewController.Initialize(this); } if (MenuController != null) { MenuController.Initialize(this); } if (FileChooser != null) { FileChooser.Initialize(this); } if (Dialog != null) { Dialog.Initialize(this); } }
protected Control CreateControl(File file, IModelFile modelfile) { var view = new ModelView(); var controller = new ModelViewController(view); var fileName = file.Name; var fileNameWOE = fileName.Substring(0, fileName.LastIndexOf('.')); List <TextureFile> textures = new List <TextureFile>(); TryLoadTexture(textures, file, fileNameWOE); TryLoadTexture(textures, file, "vehshare"); TryLoadTexture(textures, file, "vehshare_truck"); controller.TextureFiles = textures.ToArray(); controller.ModelFile = modelfile; return(view); }