private void Start() { DownloadTextureBundles(); GameData.mGameSettings.mMusicVolume = 0f; mCurrentScroll = fMiddle; if (GameObject.Find("BanzaiMusic(Clone)") == null) { BanzaiMusic = (UnityEngine.Object.Instantiate(BanzaiMusic) as GameObject); } else { BanzaiMusic = GameObject.Find("BanzaiMusic(Clone)"); } if (GameObject.Find("AtlasMusic(Clone)") == null) { AtlasMusic = (UnityEngine.Object.Instantiate(AtlasMusic) as GameObject); } else { AtlasMusic = GameObject.Find("AtlasMusic(Clone)"); } if (GameObject.Find("GameMusic(Clone)") == null) { GameMusic = (UnityEngine.Object.Instantiate(GameMusic) as GameObject); GameMusic.GetComponent <AudioSource>().volume = 1f * GameData.mGameSettings.mMusicVolume; } else { GameMusic = GameObject.Find("GameMusic(Clone)"); GameMusic.GetComponent <AudioSource>().volume = 1f * GameData.mGameSettings.mMusicVolume; } if (GameData.MasterSuitList.Count == 0) { GameData.InitSuitList(string.Empty); } mSuitInspector = new SuitInspector(); mSuitInspector.Init(); mSuitInspector.mSharedHudSkin = GUIUtil.mInstance.mSharedSkin; mSuitInspector.mShowcaseSkin = GUIUtil.mInstance.mShowcaseSkin; mSuitInspector.mCameraOffset = (mSuitInspector.mDefaultCameraPosition = Vector3.zero); mSuitInspector.ModelTransforms[0] = null; mSuitInspector.ModelTransforms[1] = GUIUtil.mInstance.mBackground; mSuitInspector.ModelPositions[0] = new Vector3(4f, -5f, 23.5f); mSuitInspector.ModelPositions[1] = new Vector3(4.15f, -5f, 24.5f); StartCoroutine(UpdateScreenSpace()); if (BanzaiMusic.GetComponent("SoundObject") != null) { (BanzaiMusic.GetComponent("SoundObject") as SoundObject).enabled = false; } if (AtlasMusic.GetComponent("SoundObject") != null) { (AtlasMusic.GetComponent("SoundObject") as SoundObject).enabled = false; } }
public TabShowcase(GameHome Parent) { mParent = Parent; mSuitInspector.Init(); mSuitInspector.mCameraOffset = (mSuitInspector.mDefaultCameraPosition = Vector3.zero); mSuitInspector.ModelTransforms[0] = null; mSuitInspector.ModelTransforms[1] = GUIUtil.mInstance.mBackground; mSuitInspector.ModelPositions = new Vector3[4]; mSuitInspector.ModelPositions[0] = new Vector3(0f, -6f, 27.5f); mSuitInspector.ModelPositions[1] = new Vector3(0.25f, -6f, 28.5f); mSuitInspector.ModelPositions[2] = new Vector3(0.25f, -6f, 28.5f); mSuitInspector.ModelPositions[3] = new Vector3(-1.25f, 0f, 35f); mSuitInspector.ModelRotations = new Vector3[4]; mSuitInspector.ModelRotations[0] = new Vector3(0f, 180f, 0f); mSuitInspector.ModelRotations[1] = new Vector3(0f, 180f, 0f); mSuitInspector.ModelRotations[2] = new Vector3(0f, 180f, 0f); mSuitInspector.ModelRotations[3] = new Vector3(90f, 180f, 0f); setStyle(); int num = 0; foreach (Exosuit value in GameData.MasterSuitList.Values) { if (value.mFactionId == GameData.MyFactionId) { SuitInspector.TempSuitInfo item = new SuitInspector.TempSuitInfo { mSuitName = value.mSuitName, mIndex = value.mSuitId, mDescription = value.mDescription, mCost = value.mCost, mSuitShow = value.mShowName, mShieldPower = value.mBaseHealth, mShieldRegen = value.mBaseRegenHealth, mJetpack = value.mBaseJetFuel, mSpeed = value.mBaseSpeed, mTech = value.mBaseTech, mWeaponModName = value.mWeaponModName, mWeaponModDescription = value.mWeaponModDescription, mLevelRequirement = value.mLevelRequirement }; mSuits.Add(item); num++; } } foreach (Exosuit value2 in GameData.MasterSuitList.Values) { if (value2.mFactionId == GameData.MyFactionId) { int priority = 50; if (value2.mSuitId == GameData.MySuitID) { priority = 100; } else if (GameData.MyOwnedSuitIDs.Contains(value2.mSuitId)) { priority = 75; } if (GameData.getExosuit(value2.mSuitId).getHighPolyModel() == null) { AssetLoader.AddSuitToLoad(value2.mSuitId, AssetLoader.SuitAsset.SuitType.high, priority); } } } bool flag = true; while (flag) { flag = false; for (int i = 0; i < mSuits.Count - 1; i++) { if (mSuits[i].mCost > mSuits[i + 1].mCost) { SwapSuits(i, i + 1); flag = true; } else if (mSuits[i].mCost == mSuits[i + 1].mCost && mSuits[i].mIndex > mSuits[i + 1].mIndex) { SwapSuits(i, i + 1); flag = true; } } } if (!GameData.MyOwnedSuitIDs.Contains(GameData.MySuitID)) { GameData.AddOwnedSuit(GameData.MySuitID); } SetCurrentSelection(GetSuitIndexFromID(GameData.MySuitID)); }