Exemple #1
0
 private void ChangeCharacter(int index)
 {
     currentCharacterIndex          = index;
     currentCharacter               = characterDefinitionSet.GetDefinition(currentCharacterIndex);
     characterSpriteRenderer.sprite = currentCharacter.portrait;
     currentTank = currentCharacter.defaultTankDefinition;
     tankRepresentation.LoadTankDefinition(currentTank);
     characterNameText.text = currentCharacter.name;
 }
Exemple #2
0
    public void LoadTankDefinition(TankDefinition definition)
    {
        tankBase.sprite   = definition.tankBase.sprite;
        tankTreads.sprite = definition.tankTreads.sprite;
        tankTurret.sprite = definition.tankTurret.sprite;

        tankBaseOutline.sprite   = definition.tankBase.outlineSprite;
        tankTreadsOutline.sprite = definition.tankTreads.outlineSprite;
        tankTurretOutline.sprite = definition.tankTurret.outlineSprite;
    }
Exemple #3
0
    public T CreateTank <T>(TankController controller, TankDefinition definition) where T : TankManager
    {
        T tank = (T)Instantiate(defaultTank);

        tank.LoadTankDefinition(definition);
        defaultTank.controller = controller;
        currentTanks.Add(tank);
        tank.tankID = latestTankId++;
        return(tank);
    }
    public void SetHull(TankDefinition definition)
    {
        center.sprite  = definition.tankBase.sprite;
        outline.sprite = definition.tankBase.outlineSprite;

        var renderer = particles.GetComponent <Renderer>();
        MaterialPropertyBlock block = new MaterialPropertyBlock();

        renderer.GetPropertyBlock(block);
        block.SetTexture("_MainTex", definition.tankBase.outlineSprite.texture);
        renderer.SetPropertyBlock(block);
    }
Exemple #5
0
    public void LoadTankDefinition(TankDefinition tankDefinition)
    {
        this.tankDefinition = tankDefinition;
        tankSprite.LoadTankDefinitionSprites(tankDefinition);
        respawnSpriteController.SetHull(tankDefinition);

        var renderer = onHitParticleSystem.GetComponent <Renderer>();
        MaterialPropertyBlock block = new MaterialPropertyBlock();

        renderer.GetPropertyBlock(block);
        block.SetTexture("_MainTex", tankDefinition.tankBase.outlineSprite.texture);
        renderer.SetPropertyBlock(block);
    }