private void SetModeDisplay(string name) { DisableAll(); nameText.text = name; handicapText.Format(viewModel.HandicapLevel().ToString(), viewModel.HandicapPercentage().ToString()); presetPreview.gameObject.SetActive(true); editButton.gameObject.SetActive(true); deleteButton.gameObject.SetActive(true); handicapText.gameObject.SetActive(true); nameText.gameObject.SetActive(true); proceedButton.gameObject.SetActive(true); }
public void OnSkillChanged() { if (viewModel.IconPath() != null) { UnityEngine.Object prefabObject = Resources.Load(viewModel.IconPath()); Texture2D texture = prefabObject as Texture2D; Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 1.0f); pulse.gameObject.SetActive(true); icon.gameObject.SetActive(true); iconWhite.gameObject.SetActive(true); icon.overrideSprite = sprite; iconWhite.overrideSprite = sprite; specialization.gameObject.SetActive(viewModel.Level() != 0); level.color = viewModel.Mat().color; level.Format(viewModel.Level().ToString()); handicap.color = viewModel.Mat().color; handicap.Format(viewModel.Handicap().ToString()); OnSelectionChanged(true); } else { OnSelectionChanged(false); pulse.gameObject.SetActive(false); icon.gameObject.SetActive(false); iconWhite.gameObject.SetActive(false); specialization.gameObject.SetActive(false); } }
public IEnumerator Start() { Debug.Assert(championName != null); Debug.Assert(level != null); Debug.Assert(gear != null); yield return(StartCoroutine(App.Content.Account.ActiveChampion?.Load())); championName.text = App.Content.Account.ActiveChampion.Json["name"]; level.Format(App.Content.Account.ActiveChampion.Json["level"]); gear.Format(App.Content.Account.ActiveChampion.Json["gear"]); }
void SetupUI() { plusButton.gameObject.SetActive(viewModel.Editable()); minusButton.gameObject.SetActive(viewModel.Editable()); plusSlider.gameObject.SetActive(true); minusSlider.gameObject.SetActive(true); if (viewModel.Sign() == Model.MetricUpgrade.SpecializeSign.Positive) { minusSlider.gameObject.SetActive(false); } else if (viewModel.Sign() == Model.MetricUpgrade.SpecializeSign.Negative) { plusSlider.gameObject.SetActive(false); } plusSlider.Main = System.Math.Abs(viewModel.Level()); minusSlider.Main = System.Math.Abs(viewModel.Level()); plusSlider.Progress = System.Math.Abs(viewModel.TemporaryLevel()); minusSlider.Progress = System.Math.Abs(viewModel.TemporaryLevel()); fieldPercentage.color = viewModel.TemporaryLevel() >= 0 ? App.Resource.Material.AbilityMaterial.color : App.Resource.Material.KitMaterial.color; var temporaryFactor = viewModel.TemporaryFactor(); fieldPercentage.Format( temporaryFactor >= 0 ? "+" : "", temporaryFactor.ToString()); fieldPercentagePrevious.gameObject.SetActive(viewModel.IsPreviewing); if (viewModel.IsPreviewing) { fieldPercentagePrevious.color = viewModel.PrePreviewLevel >= 0 ? App.Resource.Material.AbilityMaterial.color : App.Resource.Material.KitMaterial.color; var previousFactor = viewModel.PrePreviewFactor; fieldPercentagePrevious.Format( previousFactor >= 0 ? "+" : "", previousFactor.ToString()); } }
private void OnSkillUpgraded() { handicap.Format(viewModel.PreviewHandicap().ToString()); overallWeight.Main = viewModel.OverallWeight(); overallWeight.Progress = viewModel.OverallPreviewWeight(); }