Exemplo n.º 1
0
    public void UpdateShield(BasicEnemy.EnemyColor shieldColor)
    {
        Color c1 = Color.white;
        Color c2 = Color.white;

        switch (shieldColor)
        {
        default:
        case BasicEnemy.EnemyColor.red:
            c1 = Color.red;
            c2 = Color.green;
            break;

        case BasicEnemy.EnemyColor.green:
            c1 = Color.green;
            c2 = Color.blue;
            break;

        case BasicEnemy.EnemyColor.blue:
            c1 = Color.blue;
            c2 = Color.red;
            break;
        }
        shieldIcon.color     = c1;
        nextShieldIcon.color = c2;
    }
Exemplo n.º 2
0
    public void SetFront(BasicEnemy.EnemyColor color)
    {
        int colornum = (int)color;

        frontText.text = "Front: " + ColorToText(colornum);
        rightText.text = "Right: " + ColorToText(colornum + 1);
        leftText.text  = "Left: " + ColorToText(colornum + 2);
    }
Exemplo n.º 3
0
    private void RotateShield()
    {
        int shieldColor = (int)frontColor;

        shieldColor = (shieldColor + 1) % 3;
        frontColor  = (BasicEnemy.EnemyColor)shieldColor;
        shield.Rotate(0, -120, 0);
        Uicontroller.UpdateShield(frontColor);
        //testUI.SetFront(frontColor);
    }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     characterController = GetComponent <CharacterController>();
     audioSource         = GetComponent <AudioSource>();
     Instance            = this;
     frontColor          = BasicEnemy.EnemyColor.red;
     ammunition          = 0;
     Uicontroller.UpdateHealth(health);
     Uicontroller.UpdateShield(frontColor);
     Uicontroller.UpdateAmmo(ammunition);
     //testUI.SetFront(frontColor);
 }
Exemplo n.º 5
0
    public void ChangeColor(BasicEnemy.EnemyColor newColor)
    {
        color = newColor;
        Material mat = null;

        switch (color)
        {
        case EnemyColor.red:
            mat = redMat;
            break;

        case EnemyColor.green:
            mat = greenMat;
            break;

        case EnemyColor.blue:
            mat = blueMat;
            break;
        }
        ColorThings.material = mat;
    }