// Use this for initialization void Start() { // parentMenu = this.gameObject.GetComponentInParent <charaMenu_parent> (); parentChara = parentMenu.getAllCharaScript(); thisAnime = this.gameObject.GetComponentInParent <Animator> (); // /* * thisPosition = this.gameObject.transform; * * Vector3 tmpV = new Vector3 (-10f, 0f, 0f); * tmpV = tmpV + thisPosition.localPosition ; * * this.gameObject.transform.localPosition = tmpV; */ thisSpriteR = this.gameObject.GetComponent <SpriteRenderer>(); Color tmpC = thisSpriteR.color; tmpC.a = 1f; thisSpriteR.color = tmpC; //スキルボタン、且つクールタイムが終わっていない場合、ボタンは削除される if (thisButtonType == 3) { float tmpF = parentChara.getRestCoolTime(); if (tmpF > 0.01f) { Destroy(this.gameObject); } } }
// Update is called once per frame void Update() { // //各種ゲージの更新 // float hpBarLength = (float)thisCharaBaseScrpt.thisChara.nowHP / (float)thisCharaBaseScrpt.thisChara.maxHP; Vector3 tmpV = new Vector3(hpBarLength, 1, 1); hpBar.localScale = tmpV; float fullExp = thisCharaBaseScrpt.calcdExp.nextLvExp - thisCharaBaseScrpt.calcdExp.beforeExp; float nowExp = thisCharaBaseScrpt.calcdExp.totalExp - thisCharaBaseScrpt.calcdExp.beforeExp; float barLength = (float)(nowExp / fullExp); if (barLength <= 0.01) { barLength = 0.01f; } Vector3 tmpV2 = new Vector3(barLength, 1f, 1f); expBar.localScale = tmpV2; float coolTimeBarLength = thisCharaBaseScrpt.getRestCoolTime(); Vector3 tmpV3 = new Vector3(coolTimeBarLength, 1f, 1f); skillTimeBar.localScale = tmpV3; labelStatus = new charaMenu_statusLabelValus(); //labelStatus.name = thisCharaBaseScrpt.thisChara.name; labelStatus.nowLv = thisCharaBaseScrpt.thisChara.nowLv.ToString("0"); labelStatus.nowHP = thisCharaBaseScrpt.thisChara.nowHP.ToString("0"); labelStatus.maxHP = thisCharaBaseScrpt.thisChara.maxHP.ToString("0"); labelStatus.nextExp = thisCharaBaseScrpt.thisChara.nextExp.ToString("0"); labelStatus.restSkillCoolTime = thisCharaBaseScrpt.thisChara.restSkillCoolTime.ToString("0.00"); labelStatus.charaIndex = thisCharaBaseScrpt.thisChara.charaNo; }