Esempio n. 1
0
        public void TestMotionFileParsing()
        {
            string motionFile = @"motions/Hiyori_m01.motion3.json";
            var    motion     = new CubismMotion(model, loadJsonFile <CubismMotionSetting>(motionFile), setting.FileReferences.Motions["Idle"][0]);

            Assert.IsTrue(motion.GlobalFadeInSeconds > 0.0f);
            Assert.IsTrue(motion.GlobalFadeOutSeconds > 0.0f);
            Assert.DoesNotThrow(() => motion.Update(1));
        }
 public CubismSpriteWithMotion(CubismModel model, IEnumerable <Texture> textures, bool disposeModel = false)
     : base(model, textures, disposeModel)
 {
     using var reader = new StreamReader(TestResources.GetModelResource(@"motions/Hiyori_m02.motion3.json"));
     motion           = new CubismMotion(model, JsonSerializer.Deserialize <CubismMotionSetting>(reader.ReadToEnd()))
     {
         Weight               = 1.0,
         LoopFading           = true,
         GlobalFadeInSeconds  = 0.5,
         GlobalFadeOutSeconds = 0.5,
     };
 }