/// <summary> /// Load your graphics content. /// </summary> protected override void LoadContent() { var basePath = GetAppDir(); Dictionary <string, object> load_data = CreatureModule.Utils.LoadCreatureJSONData(basePath + "\\Content\\iceDemonExport_character_data.json"); curCreature = new CreatureModule.Creature(ref load_data); curManager = new CreatureModule.CreatureManager(curCreature); batch = new SpriteBatch(this.GraphicsDevice); curManager.CreateAnimation(ref load_data, "default"); curAnimationName = "default"; curManager.SetActiveAnimationName(curAnimationName); curManager.SetIsPlaying(true); curManager.should_loop = true; Texture2D curTexture; curTexture = Content.Load <Texture2D>("ice.png"); curRenderer = new CreatureRenderer.Renderer(graphics.GraphicsDevice, curManager, ref curTexture); curRenderer.world = Matrix.CreateScale(new Vector3(25.0f, 25.0f, 1.0f)); }
public void InitData() { if (creature_asset) { CreatureManager ref_manager = creature_asset.GetCreatureManager(); creature_manager = new CreatureManager(ref_manager.target_creature); creature_manager.animations = ref_manager.animations; creature_manager.active_blend_run_times = new Dictionary<string, float>(ref_manager.active_blend_run_times); creature_manager.active_blend_animation_names = new List<string>(ref_manager.active_blend_animation_names); creature_manager.auto_blend_names = new List<string>(ref_manager.auto_blend_names); SetActiveAnimation(active_animation_name); creature_manager.SetIsPlaying(true); } }