Exemplo n.º 1
0
 public void SelectTower()
 {
     if (PlayerObjectRegistry.GetPlayer().state.Gold >= Data.cost)
     {
         InteractionManager.Instance.SetInteraction(new GridInteraction(Data));
     }
 }
Exemplo n.º 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;
    }
Exemplo n.º 3
0
 public override void OnEvent(IsReadyEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady = !PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady;
 }
Exemplo n.º 4
0
    public override void OnEvent(SpawnEvent evnt)
    {
        var player = PlayerObjectRegistry.GetPlayer(evnt.RaisedBy);

        EntityManager.Instance.SpawnTower((TowerType)evnt.TowerType, player, evnt.Position);
    }
Exemplo n.º 5
0
 public override void OnEvent(SetNameEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.Name = evnt.Name;
 }
Exemplo n.º 6
0
 public override void OnEvent(SetColorEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.Color = evnt.Color;
 }
Exemplo n.º 7
0
 public override void SceneLoadRemoteDone(BoltConnection connection)
 {
     PlayerObjectRegistry.GetPlayer(connection).Spawn();
 }
Exemplo n.º 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);
 }