Exemplo n.º 1
0
 void Start()
 {
     TankAttributes tankPlayer = new TankAttributes();
     tankPlayer.TnkBeauty = 18;
     tankPlayer.TnkDurability = 20;
     tankPlayer.TnkPower = 19;
 }
Exemplo n.º 2
0
    void Start()
    {
        TankAttributes tankPlayer = new TankAttributes();

        tankPlayer.TnkBeauty     = 18;
        tankPlayer.TnkDurability = 20;
        tankPlayer.TnkPower      = 19;
    }
Exemplo n.º 3
0
    void Start()
    {
        rb         = GetComponent <Rigidbody>();
        sparks     = GetComponentInChildren <ParticleSystem>();
        attributes = new TankAttributes().GetTankAttributes(tankType);

        if (attributes == null)
        {
            Debug.LogError("Unable to find tank attributes for tank type: " + tankType.ToLowerInvariant());
        }

        // The axes names are based on player number.
        movementAxisName = "Vertical" + playerNumber;
        turnAxisName     = "Horizontal" + playerNumber;
        fire1Button      = "Fire1" + playerNumber;
        fire2Button      = "Fire2" + playerNumber;
    }
Exemplo n.º 4
0
    public TankAttributes GetTankAttributes(string tankType)
    {
        TankAttributes attributes = new TankAttributes();

        switch (tankType.ToLowerInvariant())
        {
        case "player":
            attributes.movement    = TankAttributes.Movement.Normal;
            attributes.behavior    = TankAttributes.Behavior.Controlled;
            attributes.bulletSpeed = TankAttributes.BulletSpeed.Normal;
            attributes.fireRate    = TankAttributes.FireRate.Fast;
            attributes.ricochets   = TankAttributes.Ricochets.Single;
            attributes.bulletLimit = TankAttributes.BulletLimit.Large;
            attributes.mineLimit   = TankAttributes.MineLimit.Small;
            break;

        default:
            attributes = null;
            break;
        }

        return(attributes);
    }