Esempio n. 1
0
  void select() {
    if (!soundPlayed) {
      soundPlayed = true;
      if (charactersMenu.isJustOpened()) {
        charactersMenu.setOpened();
      } else {
        charactersMenu.characterSelectSound.Play();
      }

      stat = CharacterManager.cm.character(name);

      charactersMenu.characterName.text = stat.characterName;
      setRarity(charactersMenu.rarity);

      charactersMenu.description.text = stat.skillName;
      if (stat.skillName != "") {
        charactersMenu.description.text += ": " + SkillManager.sm.getSkill(stat.skillCode()).description;
      }

      checkBought();
    }

    transform.localPosition = new Vector3(transform.parent.localPosition.x, charactersMenu.selectedOffset_y, charactersMenu.selectedOffset_z);

    transform.Rotate(-Vector3.up * Time.deltaTime * charactersMenu.selectedCharacterRotationSpeed);

    if (scaleChanging != originalScale.x * 2) {
      scaleChanging = Mathf.MoveTowards(scaleChanging, originalScale.x * 2, Time.deltaTime * charactersMenu.scaleChangingSpeed);
      transform.localScale = new Vector3(scaleChanging, scaleChanging, scaleChanging);
    }

    Transform aura = transform.Find("aura");
    if (aura != null) aura.gameObject.SetActive(true);
  }