public static UObject NewImmortalObject(Type type, string name, string moduleName) { UObject o = NewObject(type, name); if (o != null) { UGlobalObject.Get().AddGlobalObject(o, moduleName); return(o); } return(null); }
public static UGlobalObject Get() { if (msGlobalObject == null) { msGlobalObject = NewObject <UGlobalObject>("GlobalObject"); if (msGlobalObject != null) { DontDestroyOnLoad(msGlobalObject.gameObject); } } return(msGlobalObject); }
public UObject AsImmortal(string moduleName) { return(UGlobalObject.Get().AddGlobalObject(this, moduleName)); }