Example #1
0
 public void SelectTower()
 {
     if (PlayerObjectRegistry.GetPlayer().state.Gold >= Data.cost)
     {
         InteractionManager.Instance.SetInteraction(new GridInteraction(Data));
     }
 }
Example #2
0
    public void Die(GameObject killer)
    {
        EntityManager.Instance.DestroyEnemy(entity.gameObject);
        var player = PlayerObjectRegistry.GetPlayer(killer.GetComponent <TowerBehaviour>().entity.controller);

        player.behavior.state.Score += _data.score;
        player.behavior.state.Gold  += _data.gold;
    }
Example #3
0
 public override void OnEvent(IsReadyEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady = !PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady;
 }
Example #4
0
    public override void OnEvent(SpawnEvent evnt)
    {
        var player = PlayerObjectRegistry.GetPlayer(evnt.RaisedBy);

        EntityManager.Instance.SpawnTower((TowerType)evnt.TowerType, player, evnt.Position);
    }
Example #5
0
 public override void OnEvent(SetNameEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.Name = evnt.Name;
 }
Example #6
0
 public override void OnEvent(SetColorEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.Color = evnt.Color;
 }
Example #7
0
 public override void SceneLoadRemoteDone(BoltConnection connection)
 {
     PlayerObjectRegistry.GetPlayer(connection).Spawn();
 }
Example #8
0
 public override void OnEvent(SpawnPlayerEvent evnt)
 {
     // Spawn the player with this customisation token and assign control to the
     // connection /player who raised the event...
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).Spawn((CustomisationToken)evnt.CustomisationToken);
 }