public BattleObject LoadFighter(int player_num) { GameObject obj = new GameObject(); BattleObject battleObj = obj.AddComponent <BattleObject>(); if (abstract_fighter_info != null) { AbstractFighter fighter = obj.AddComponent <AbstractFighter>(); } if (sprite_handler_info != null) { SpriteHandler sprite = obj.AddComponent <SpriteHandler>(); //sprite.orientation = sprite_handler_info.orientation; } if (action_handler_info != null) { ActionHandler actions = obj.AddComponent <ActionHandler>(); //actions.action_json = action_handler_info.action_json; //actions.starting_action = action_handler_info.starting_action; } if (motion_handler_info != null) { MotionHandler mot = obj.AddComponent <MotionHandler>(); } if (ecb_info != null) { //EnvironmentCollider ecb = obj.AddComponent<EnvironmentCollider>(); } foreach (VarData vardata in variables) { battleObj.SetVar(vardata.name, vardata.value); } battleObj.LoadComponents(); return(battleObj); }