Esempio n. 1
0
 private void Awake()
 {
     Rigidbody = GetComponent <Rigidbody>();
     StateInfo = new ItemStateInfo()
     {
     };
 }
Esempio n. 2
0
    public override void InitStateInfo(ItemStateInfo stateInfo)
    {
        FlashlightStateInfo casted = (FlashlightStateInfo)stateInfo;

        this.StateInfo.IsLightOn = casted.IsLightOn;
        RefreshLight();
    }
Esempio n. 3
0
    public override void InitStateInfo(ItemStateInfo stateInfo)
    {
        RangedWeaponStateInfo casted = (RangedWeaponStateInfo)stateInfo;

        this.StateInfo.FireMode          = casted.FireMode;
        this.StateInfo.AmmoClipStateInfo = casted.AmmoClipStateInfo;

        if (this.StateInfo.AmmoClipStateInfo != null)
        {
            if (StateInfo.AmmoClipStateInfo.ProjectileCount > 0)
            {
                AmmoClip = (AmmoClip)GameObject.Instantiate(StateInfo.AmmoClipStateInfo.Prefab);
                AmmoClip.transform.SetParent(AmmoClipParent);
                AmmoClip.transform.localPosition = Vector3.zero;
                AmmoClip.transform.localRotation = Quaternion.identity;
            }
        }
    }
Esempio n. 4
0
 /// <summary>
 /// Called by the EquipmentManager to apply the non-shared state to a newly created item (retrieved from the inventory)
 /// </summary>
 public abstract void InitStateInfo(ItemStateInfo stateInfo);
Esempio n. 5
0
 public override void InitStateInfo(ItemStateInfo stateInfo)
 {
     this.StateInfo.Depleted = stateInfo.Depleted;
 }
Esempio n. 6
0
    public override void InitStateInfo(ItemStateInfo stateInfo)
    {
        AmmoClipStateInfo casted = (AmmoClipStateInfo)stateInfo;

        this.StateInfo.ProjectileCount = casted.ProjectileCount;
    }
Esempio n. 7
0
 public InventoryItem(ItemContext context, ItemStateInfo stateInfo)
 {
     this.context   = context;
     this.stateInfo = stateInfo;
 }