public virtual void UseItem(GamePad.Index playerNo, KeyBoard.Index playerKeyNo) { if (GamePad.GetButton(GamePad.Button.B, playerNo) || KeyBoard.GetButton(KeyBoard.Button.B, playerKeyNo)) { // アイテムを所持しているか if (m_sItemData != null) { // 置く場所が適切かどうか if (IsUseItem() == true) { // アクション時間が経過しているか if (m_fActionTime <= 0f) { UseItem(); // アクション経過時間を再設定 m_fActionTime = m_fLimitActionTime; ItemHolderManager.Instance.UsingFromHolder(0, playerNo, playerKeyNo); } else { // アクション時間を経過させる m_fActionTime -= Time.deltaTime; float TimeParLimitTime = (m_fLimitActionTime - m_fActionTime) / m_fLimitActionTime; ItemHolderManager.Instance.UsingFromHolder(TimeParLimitTime, playerNo, playerKeyNo); } } } } else { // アクション経過時間を再設定 m_fActionTime = m_fLimitActionTime; ItemHolderManager.Instance.UsingFromHolder(0, playerNo, playerKeyNo); } }
public void UsingFromHolder(float Time, GamePad.Index playerNo, KeyBoard.Index playerKeyNo) { if (playerNo == GamePad.Index.One || playerKeyNo == KeyBoard.Index.One) { CircleList[0].GetComponent <Image>().fillAmount = Time; } if (playerNo == GamePad.Index.Three || playerKeyNo == KeyBoard.Index.Three) { CircleList[1].GetComponent <Image>().fillAmount = Time; } }