Exemple #1
0
    public override void DeselectItem(ItemOperationInfo info)
    {
        if (info.entity == null)
        {
            return;
        }
        EntityItemController eic;

        if (info.entity.TryGetComponent(out eic))
        {
            eic.Deselect(info);
        }
    }
Exemple #2
0
    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);
        }
    }
Exemple #4
0
    public override void UseItemEnd(ItemOperationInfo info)
    {
        EntityItemController eic = info.entity.GetComponent <EntityItemController>();

        eic.FireUp(info);
    }
Exemple #5
0
 public override void Deselect(ItemOperationInfo info)
 {
 }
Exemple #6
0
 public override void FireUp(ItemOperationInfo info)
 {
 }
Exemple #7
0
 public override void FireDown(ItemOperationInfo info)
 {
     Instantiate(bullet, Muzzle.position, transform.rotation);
 }
Exemple #8
0
 public virtual void FireDown(ItemOperationInfo info)
 {
 }
Exemple #9
0
 public virtual void Deselect(ItemOperationInfo info)
 {
 }
Exemple #10
0
 public virtual void UseItemEnd(ItemOperationInfo info)
 {
 }
Exemple #11
0
 public virtual void UseItemStart(ItemOperationInfo info)
 {
 }
Exemple #12
0
 public virtual void SelectItem(ItemOperationInfo info)
 {
 }