private float lerpSpeed = 3f; /// <value> Speed at which aciton text fades in </value> /// <summary> /// Awake to get all components attached to the Action button /// </summary> void Awake() { b = GetComponent <Button>(); bts = GetComponent <ButtonTransitionState>(); img = GetComponent <Image>(); t = GetComponentInChildren <TextMeshProUGUI>(); ColorBlock normalBlock = b.colors; ColorBlock unusableBlock = b.colors; ColorBlock highlightedBlock = b.colors; ColorBlock disabledBlock = b.colors; ColorBlock STRBlock = b.colors; ColorBlock DEXBlock = b.colors; ColorBlock INTBlock = b.colors; ColorBlock LUKBlock = b.colors; unusableBlock.normalColor = new Color32(196, 36, 48, 255); unusableBlock.highlightedColor = new Color32(255, 0, 64, 255); unusableBlock.pressedColor = new Color32(120, 36, 48, 255); unusableBlock.disabledColor = new Color32(120, 36, 48, 255); disabledBlock.normalColor = disabledBlock.disabledColor; disabledBlock.highlightedColor = disabledBlock.disabledColor; disabledBlock.pressedColor = disabledBlock.disabledColor; highlightedBlock.normalColor = normalBlock.pressedColor; STRBlock.normalColor = new Color32(185, 29, 0, 125); STRBlock.highlightedColor = new Color32(185, 29, 0, 175); STRBlock.pressedColor = new Color32(185, 29, 0, 255); STRBlock.disabledColor = new Color32(61, 61, 61, 255); DEXBlock.normalColor = new Color32(90, 197, 79, 125); DEXBlock.highlightedColor = new Color32(90, 197, 79, 175); DEXBlock.pressedColor = new Color32(90, 197, 79, 255); DEXBlock.disabledColor = new Color32(90, 197, 79, 255); INTBlock.normalColor = new Color32(0, 152, 220, 125); INTBlock.highlightedColor = new Color32(0, 152, 220, 175); INTBlock.pressedColor = new Color32(0, 152, 220, 255); INTBlock.disabledColor = new Color32(61, 61, 61, 255); LUKBlock.normalColor = new Color32(255, 205, 2, 125); LUKBlock.highlightedColor = new Color32(255, 205, 2, 175); LUKBlock.pressedColor = new Color32(255, 205, 2, 255); LUKBlock.disabledColor = new Color32(61, 61, 61, 255); bts.SetColorBlock("normal", normalBlock); bts.SetColorBlock("na0", unusableBlock); bts.SetColorBlock("na1", STRBlock); bts.SetColorBlock("na2", DEXBlock); bts.SetColorBlock("na3", INTBlock); bts.SetColorBlock("na4", LUKBlock); bts.SetColorBlock("highlighted", highlightedBlock); bts.SetColorBlock("disabled", disabledBlock); }
private bool selectButtonEnabled = false; /// <value> Select button will only move to next scene if a class is selected </value> /// <summary> /// Awake to intialize eventSystem and select button's alternate colour blocks /// </summary> void Awake() { es = EventSystem.current; classButtons = GetComponentsInChildren <ClassButton>(); ColorBlock sbEnabledBlock = selectButton.colors; sbEnabledBlock.normalColor = new Color32(215, 215, 215, 255); sbEnabledBlock.highlightedColor = new Color32(255, 255, 255, 255); sbEnabledBlock.pressedColor = sbEnabledBlock.highlightedColor; sbBts = selectButton.GetComponent <ButtonTransitionState>(); sbBts.SetColorBlock("normalAlternate", sbEnabledBlock); }
private TextMeshProUGUI t; /// <value> Text display </value> /// <summary> /// Awake to get all components attached to the Action button /// </summary> void Awake() { b = GetComponent <Button>(); bts = GetComponent <ButtonTransitionState>(); img = GetComponent <Image>(); t = GetComponentInChildren <TextMeshProUGUI>(); ColorBlock normalBlock = b.colors; ColorBlock unusableBlock = b.colors; unusableBlock.normalColor = new Color32(196, 36, 48, 255); unusableBlock.highlightedColor = new Color32(255, 0, 64, 255); unusableBlock.pressedColor = new Color32(120, 36, 48, 255); unusableBlock.disabledColor = new Color32(120, 36, 48, 255); bts.SetColorBlock("normal", normalBlock); bts.SetColorBlock("normalAlternate", unusableBlock); }
} = false; /// <value> Monster finished loading </value> #region Initialization /// <summary> /// Initializes the monster's properties and display /// </summary> /// <param name="monsterNameID"> Name of monster as referenced by the database </param> /// <param name="monsterSpriteName"> Name of monster's sprite, castle case </param> /// <param name="monsterDisplayName"> Name of monster in game </param> /// <param name="monsterArea"> Area of monster to get file path to sprite, castle case </param> /// <param name="monsterSize"> Size of monster (small, medium, large) </param> /// <param name="monsterAI"> Pattern for how monster attacks </param> /// <param name="LVL"> Power level </param> /// <param name="HP"> Max health points </param> /// <param name="MP"> Max mana points </param> /// <param name="stats"> STR, DEX, INT, LUK </param> /// <param name="attacks"> List of known attacks (length 4) </param> public IEnumerator Init(string monsterNameID, string monsterSpriteName, string monsterDisplayName, string monsterArea, string monsterSize, string monsterAI, int LVL, int HP, int MP, int[] stats, Attack[] attacks) { base.Init(LVL, HP, MP, stats, attacks); bts = b.GetComponent <ButtonTransitionState>(); this.monsterNameID = monsterNameID; this.monsterDisplayName = monsterDisplayName; this.monsterArea = monsterArea; this.monsterAI = monsterAI; /* WHEN WORKING WITH WIFI AND/OR WANT TO USE ASSETBUNDLES */ //CoroutineWithData cd = new CoroutineWithData(this, AssetBundleManager.instance.LoadSpriteAssetFromBundle("monster", monsterSpriteName)); //yield return cd.coroutine; //monsterSprite.sprite = (Sprite)cd.result; /**********************************************************/ /* WHEN NO WIFI */ string spritePath = "Sprites/Enemies/" + monsterArea + "/" + monsterSpriteName; /****************/ monsterSprite.sprite = Resources.Load <Sprite>(spritePath); // sprite path will always be inside resources folder this.monsterSize = monsterSize; SetSize(monsterSize); SetHealthBar(); foreach (Attack a in attacks) { if (a.name != "none") { attackNum++; } } SetCamera(); SetMonsterAnimatorClips(); this.isReady = true; yield break; }
private string classDescription; /// <value> Description of class </value> /// <summary> /// Awake to intialize bts and let other scripts know the button isReady /// </summary> void Awake() { bts = b.GetComponent <ButtonTransitionState>(); isReady = true; }