// public bool muted { get { return allMuted <= 0; } set { } } private void Awake() { canChangeMusicNow = true; instance = instance ?? this; DontDestroyOnLoad(gameObject); soundVolume = HelpSaveLoad.GetValue(ConstsLibrary.soundEffectVolumePrefs, 1f); musicVolume = HelpSaveLoad.GetValue(ConstsLibrary.musicVolumePrefs, 1f); allMuted = HelpSaveLoad.GetValue(ConstsLibrary.mutedPrefs, 0); foreach (var item in soundSettings) { item.source = gameObject.AddComponent <AudioSource>(); item.source.volume = soundVolume * item.volumeDecreaser; item.source.clip = item.audioClip; item.source.priority = item.priority; item.source.loop = item.loop; } foreach (var item in musicSettings) { item.source = gameObject.AddComponent <AudioSource>(); item.source.volume = musicVolume * item.volumeDecreaser; item.source.clip = item.audioClip; item.source.priority = item.priority; item.source.loop = item.loop; } if (allMuted == 1) { MuteAll(true); } else { MuteAll(false); } }
private void StartingNodeInitiation() { foreach (var nodeControl in techNodeControlList) { int nodeState = HelpSaveLoad.GetValue(nodeControl.techNodeStats.nodeName, 0); if ((nodeState != nodeDonePP) && (nodeControl.techNodeStats.nodeDependsOn == null || nodeControl.techNodeStats.nodeDependsOn.Length <= 0)) { nodeState = nodeOpenPP; } nodeControl.nodeCondition = nodeState; switch (nodeState) { case 0: //Not open nodeControl.NodeIncative(); break; case 1: //Open nodeControl.NodeActive(); break; default: //Researched nodeControl.NodeResearched(); //--- break; } } }
public void LoadCurrent() { playerCash = HelpSaveLoad.GetValue(ConstsLibrary.playerCash, 0f); cashPerSecond = HelpSaveLoad.GetValue(ConstsLibrary.cashPerSecond, startingCashPerSecond); cashPerStart = HelpSaveLoad.GetValue(ConstsLibrary.cashPerStart, startingCashPerStart); missionCashMultipyer = HelpSaveLoad.GetValue(ConstsLibrary.cashPerMissionMultiplyer, missionCashMutipyerBase); rocketCrashCost = HelpSaveLoad.GetValue(ConstsLibrary.rocketCrashCost, startingRocketCrashCost); }
//Set Particles+ //Set Starting Menu private void LevelInitiation() { int nodesCount = HelpSaveLoad.GetValue(ConstsLibrary.openNodesCount, 0); PlayerStats.instance.OpenTechNodesCount(nodesCount); GameMaster.instance.day = GameMaster.instance.iteration; // print("day LevelInitiation " + day); HelpSaveLoad.SetValue(ConstsLibrary.day, GameMaster.instance.iteration); InGameWiever.instance.SetDayText(GameMaster.instance.iteration); GameMaster.instance.hardness = HelpSaveLoad.GetValue(ConstsLibrary.hardnessPrefs, 0); }
public void ResetVaues() { additionalStagesCount = HelpSaveLoad.GetValue(ConstsLibrary.rocketStagesValue, 0); canTakeDamage = canTakeDamageTimer; foreach (var item in allRocketSprites) { item.color = Color.white; } RocketStageEngine.instance.ResetStages(); InGameWiever.instance.ResetHelthBar(maxRocketHealth); SetRocketType(additionalStagesCount); if (allRocketSprites.Count > 0) { VisualEffectHelper.instance.ToBaseColor(allRocketSprites, gameObject.GetInstanceID()); } healthCounter = maxRocketHealth; greatDisable = false; steersDisable = false; rocketHeat = 0; diasbleAll = false; //Stages singleStageNotDroped = true; firstStageNotDroped = true; secondStageNotDroped = true; RocketEngineParticles.instance.SetFireSetNumber(particleClorNumber); List <SpriteRenderer> allSprites = GetComponentsInChildren <SpriteRenderer>().ToList(); foreach (var item in allSprites) { if (item.gameObject.active) { allRocketSprites.Add(item); } } fuel = maxFuel; TimerReset(); }
void Start() { resolutions = Screen.resolutions; resolutionsDropdown.ClearOptions(); List <string> options = new List <string>(); int currentResolutionIndex = 0; for (int i = 0; i < resolutions.Length; i++) { string option = resolutions[i].width + "x" + resolutions[i].height; options.Add(option); // options.Add(resolutions[i].width + "x" + resolutions[i].height); if ((resolutions[i].width == Screen.currentResolution.width) && (resolutions[i].height == Screen.currentResolution.height)) { currentResolutionIndex = i; } } resolutionsDropdown.AddOptions(options); resolutionsDropdown.value = currentResolutionIndex; resolutionsDropdown.RefreshShownValue(); //music in Menu mainTheme = gameObject.AddComponent <AudioSource>(); mainTheme.clip = menuTheme.audioClip; mainTheme.volume = HelpSaveLoad.GetValue(ConstsLibrary.musicVolumePrefs, 1f) * menuTheme.volumeDecreaser; mainTheme.loop = true; mainTheme.mute = HelpSaveLoad.GetValue(ConstsLibrary.mutedPrefs, 0) == 1; PlayFirstMusic(); }
void Start() { isMutedToggle.isOn = HelpSaveLoad.GetValue(ConstsLibrary.mutedPrefs, 0) == 1; musicSlider.value = HelpSaveLoad.GetValue(ConstsLibrary.musicVolumePrefs, 1f); effectsSlider.value = HelpSaveLoad.GetValue(ConstsLibrary.soundEffectVolumePrefs, 1f); }
private void SetStartingValues() { iteration = HelpSaveLoad.GetValue(ConstsLibrary.iteration, 0); day = HelpSaveLoad.GetValue(ConstsLibrary.day, 0); }