public void UnLoadAssets() { if (mAssetMap != null) { foreach (KeyValuePair <int, UnityEngine.Object> kvp in mAssetMap) { if (kvp.Value != null) { UnLoadAsset(kvp.Value); } } mAssetMap.Clear(); mAssetMap = null; } if (mMainAsset != null) { UnLoadAsset(mMainAsset); } mMainAsset = null; }
public void CopyFrom(WISaveState saveState) { CanEnterInventory = saveState.CanEnterInventory; CanBeCarried = saveState.CanBeCarried; CanBeDropped = saveState.CanBeDropped; UnloadWhenStacked = saveState.UnloadWhenStacked; LastState = saveState.LastState; if (Scripts == null) { Scripts = new SDictionary <string, string>(); } else { Scripts.Clear(); } var scriptsEnum = saveState.Scripts.GetEnumerator(); while (scriptsEnum.MoveNext()) { Scripts.Add(scriptsEnum.Current.Key, scriptsEnum.Current.Value); } }