Exemple #1
0
    //使用時、残数を減らしてテキストを表示、残数が0になったら捨てる
    public override void ItemEffect()
    {
        base.ItemEffect();

        if (_mouseController.HitObject.collider != null && _mouseController.HitObject.collider.gameObject.tag == "Lamp")
        {
            _use_restrictions          -= 1;
            _use_restrictions_Text.text = "(残り:" + _use_restrictions.ToString() + "本)";
            _use_restrictions_Object.SetActive(true);

            _lamp = _mouseController.HitObject.collider.gameObject.GetComponent <Lamp>();
            _lamp.Ignition();
            if (_use_restrictions == 0)
            {
                _itemManager.DisposeItem();
            }
        }
    }