public override void DeselectItem(ItemOperationInfo info) { if (info.entity == null) { return; } EntityItemController eic; if (info.entity.TryGetComponent(out eic)) { eic.Deselect(info); } }
public override void SelectItem(ItemOperationInfo info) { GameObject entity = Instantiate(EntityPrefab); EntityItemController eic = entity.GetComponent <EntityItemController>(); eic.Select(info); EntityHolder eh; if (info.invoker.TryGetComponent(out eh)) { eh.Hold(entity); } }
public override void UseItemStart(ItemOperationInfo info) { Pack pack = info.invoker.GetComponent <Pack>(); BlockObject bo = BlockFactory.Instance.GetBlockObject(placedBlockId); Vector3Int pos = new Vector3Int( Mathf.FloorToInt(info.operationPosition.x), Mathf.FloorToInt(info.operationPosition.y), 0); if (pack.SelectedItem.count > 0 && bo.SetBlock(pos)) { pack.ConsumeItemAtIndex(pack.SelectedItemIndex, 1); } }
public override void UseItemEnd(ItemOperationInfo info) { EntityItemController eic = info.entity.GetComponent <EntityItemController>(); eic.FireUp(info); }
public override void Deselect(ItemOperationInfo info) { }
public override void FireUp(ItemOperationInfo info) { }
public override void FireDown(ItemOperationInfo info) { Instantiate(bullet, Muzzle.position, transform.rotation); }
public virtual void FireDown(ItemOperationInfo info) { }
public virtual void Deselect(ItemOperationInfo info) { }
public virtual void UseItemEnd(ItemOperationInfo info) { }
public virtual void UseItemStart(ItemOperationInfo info) { }
public virtual void SelectItem(ItemOperationInfo info) { }