So I have this class for character dialogs and I’m building a set of Lists using it
class ScriptStep {
var stepType : StepType;
var subScript : List.<ScriptStep>;
var stepDuration : float;
var stepTransform : Transform;
var audioClip : AudioClip;
var textLine : String;
var stepAction : function():void;
var stepActionFade : function(float):void;
var stepSelectedObject : Obj_Properties_Class;
var stepPlayerTask : PlayerTaskList;
var stepWifeTask : WifeTaskList;
var stepBurglar01Task : Burglar01TaskList;
var cooperateScript : List.<ScriptStep>;
var refuseScript : List.<ScriptStep>;
}
Everything is working well until I realized that by adding those 2 extra variables in the class:
var cooperateScript : List.<ScriptStep>;
var refuseScript : List.<ScriptStep>;
My .unity file size changes from 600k to 100Mb and the game takes ages to run when I press “Play”. Everything runs fine but its like I added a huge slowdown.
If I remove those 2 variables in the class everything goes back to normal.
I would like to understand why this is happening. Am I typing the variables badly? Am I not allow to add a list inside another list?
Any help very appreciated!