public static float GetSuitLoadProgress(int suitID, SuitAsset.SuitType model_type) { if (mInstance.mCurrentLoading == null) { return(0f); } foreach (SuitAsset item in mInstance.mAssetQueue) { if (item.mSuitID == suitID && item.myFilename == mInstance.mCurrentLoading.myFilename) { if (mInstance.mCurrentLoading.myWWW != null) { return(mInstance.mCurrentLoading.myWWW.progress); } return(0f); } } return(0f); }
public static void AddSuitToLoad(int suitId, SuitAsset.SuitType model_type, int Priority) { if (mInstance == null) { Debug.Log("<< mInstance is null "); } foreach (SuitAsset item in mInstance.mAssetQueue) { if (item == null) { Debug.Log("<< Suit is null " + mInstance.mAssetQueue.Count); } if (item.mSuitID == suitId && item.mModelType == model_type) { if (item.mPriority != Priority) { item.mPriority = Priority; mInstance.mAssetQueue.Sort(ComparePriority); } return; } } Exosuit exosuit = GameData.getExosuit(suitId); if (exosuit != null) { string mSuitFileName = exosuit.mSuitFileName; string str = mSuitFileName + "_" + model_type + ".unity3d"; SuitAsset suitAsset2 = new SuitAsset(); suitAsset2.mSuitID = suitId; suitAsset2.mPriority = Priority; suitAsset2.myFilename = "suits/" + str; suitAsset2.mModelType = model_type; mInstance.mAssetQueue.Add(suitAsset2); mInstance.mAssetQueue.Sort(ComparePriority); } }