//For combat API //Input: percentage in decimal form (between 0-1) public void DealPercentDmgToBoss(float percent) { var evnt = DealPercentDmgToBossEvent.Create(Bolt.GlobalTargets.OnlyServer); evnt.percent = percent; evnt.Send(); }
/*Only the server recieves this event.*/ public override void OnEvent(DealPercentDmgToBossEvent evnt) { gameStateEntity.GetComponent <NetworkGameState>() .DealPercentDmgToBoss(evnt.percent); gameStateEntity.GetComponent <NetworkGameState>() .IncrementAttackCount(); }