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, }; }
public TestSceneCubismSprite() { var moc = new CubismMoc(TestResources.GetModelResource("Hiyori.moc3")); var textures = new[] { Texture.FromStream(TestResources.GetModelResource("textures/texture_00.png")), Texture.FromStream(TestResources.GetModelResource("textures/texture_01.png")), }; Model = new CubismModel(moc); Sprite = CreateSprite(Model, textures); Sprite.Size = new Vector2(SpriteSize); Sprite.Anchor = Anchor.Centre; Sprite.Origin = Anchor.Centre; Add(Sprite); }
public void SetUp() { var moc = new CubismMoc(TestResources.GetModelResource("Hiyori.moc3")); model = new CubismModel(moc); }
private T loadJsonFile <T>(string file) { using var reader = new StreamReader(TestResources.GetModelResource(file)); return(JsonSerializer.Deserialize <T>(reader.ReadToEnd())); }
public void SetUp() { moc = new CubismMoc(TestResources.GetModelResource(@"Hiyori.moc3")); model = new CubismModel(moc); setting = loadJsonFile <CubismModelSetting>(@"Hiyori.model3.json"); }
public CubismSpriteWithPhysics(CubismModel model, IEnumerable <Texture> textures, bool disposeModel = false) : base(model, textures, disposeModel) { using var reader = new StreamReader(TestResources.GetModelResource(@"Hiyori.physics3.json")); physics = new CubismPhysics(model, JsonSerializer.Deserialize <CubismPhysicsSetting>(reader.ReadToEnd())); }