public override void EndOfUse() { if (!endTriggered) { if (onPointReached != null) { if (destroyAtPreviousCell) { onPointReached.Invoke(previousValidPosCell); } else { onPointReached.Invoke(currentValidPosCell); } } liveProjectile.DestroyProjectile(); endTriggered = true; } }
public virtual bool Use() { if (CanUse()) { AmountStack--; OnUsed?.Invoke(); return(true); } OnFailUsed?.Invoke(); return(false); }
public void OnPointerUp(PointerEventData eventData) { if (_buidlingInstance.GetComponent <BuildingDragger>().PutDownCube()) { OnUsed?.Invoke(); Destroy(this.gameObject); } else { Destroy(_buidlingInstance); } }
public void Use() { if (!CanUse()) { return; } _cooldown = 1 / _useSpeed; if (_hasAmmunition) { _currentAmmunition -= 1; if (_currentAmmunition == 0) { Reload(); } } OnUsed?.Invoke(); }
public override bool Perform() { if (actorInteracting == null) { Debug.LogError("Actor not set"); return(false); } celllocationToSpawn = GridManager.instance.grid.WorldToCell(actorInteracting.transform.position + GridManager.instance.GetFacingDirectionOffsetVector3(actorInteracting.Facing)); Debug.Log("Drop performing here"); if (onActionOver != null) { Debug.Log("onActionOver"); onActionOver.Invoke(actorInteracting); } if (onActionOverOnCellPosition != null) { Debug.Log("onActionOverOnCellPosition"); onActionOverOnCellPosition.Invoke(celllocationToSpawn); } return(true); }
public override bool Perform() { if (!initialiseSprite) { if (onMoveUseActionBegin != null) { onMoveUseActionBegin.Invoke(actorUsingMove); } //Debug.Log("initialiseSprite"); actorUsingMove.UpdateBasicWalkingSprite(); actorUsingMove.frameLooper.timeBetweenFrames = animationSpeed; initialiseSprite = true; } else { if (!actorUsingMove.frameLooper.isRepeatingLoop) { actorUsingMove.frameLooper.UpdateAnimationFrame(); return(true); } else { if (!isBeingUsed) { CancelMoveUsage(); } if (onMoveUseActionOver != null) { //Debug.LogError("sasa"); onMoveUseActionOver.Invoke(actorUsingMove); } return(false); } } return(false); }
public ValueType Use() { OnUsed.Invoke(Value); return(Value); }
protected void TriggerOnUse() { OnUsed?.Invoke(); }