Exemplo n.º 1
0
    public bool FireLaser(string laserName, Vector2 targetPosn)
    {
        Node laser = null;

        if (nodes.TryGetValue(laserName, out laser))
        {
            WeaponsNode ln = (WeaponsNode)laser;
            return(ln.FireAt(targetPosn));
        }

        Debug.LogError("Invalid weapons node '" + laserName + "'");
        return(false);
    }
Exemplo n.º 2
0
 internal PlayerNode(string json)
     : base(json)
 {
     SteamID      = GetString("steamid");
     Name         = GetString("name");
     ObserverSlot = GetInt32("observer_slot");
     Team         = GetEnum <PlayerTeam>("team");
     Clan         = GetString("clan");
     State        = new PlayerStateNode(_data?.SelectToken("state")?.ToString() ?? "{}");
     Weapons      = new WeaponsNode(_data?.SelectToken("weapons")?.ToString() ?? "{}");
     MatchStats   = new MatchStatsNode(_data?.SelectToken("match_stats")?.ToString() ?? "{}");
     Activity     = GetEnum <PlayerActivity>("activity");
     Position     = GetVector3("position");
     Forward      = GetVector3("forward");
     SpecTarget   = GetString("spectarget");
 }