private void Awake() { Rigidbody = GetComponent <Rigidbody>(); StateInfo = new ItemStateInfo() { }; }
public override void InitStateInfo(ItemStateInfo stateInfo) { FlashlightStateInfo casted = (FlashlightStateInfo)stateInfo; this.StateInfo.IsLightOn = casted.IsLightOn; RefreshLight(); }
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; } } }
/// <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);
public override void InitStateInfo(ItemStateInfo stateInfo) { this.StateInfo.Depleted = stateInfo.Depleted; }
public override void InitStateInfo(ItemStateInfo stateInfo) { AmmoClipStateInfo casted = (AmmoClipStateInfo)stateInfo; this.StateInfo.ProjectileCount = casted.ProjectileCount; }
public InventoryItem(ItemContext context, ItemStateInfo stateInfo) { this.context = context; this.stateInfo = stateInfo; }