Пример #1
0
    private void Start()
    {
        control_holder = GetComponent <Vehicle_Control_Holder>();
        renderers      = this.gameObject.GetComponentsInChildren <MeshRenderer>();
        if (control_holder != null)
        {
            print(control_holder.Get_Player_Index());
            switch (control_holder.Get_Player_Index())
            {
            case 0:
                Switch_Colour(new Color(100f / 255, 176f / 255, 88f / 255));
                break;

            case 1:
                Switch_Colour(new Color(64f / 255, 127f / 255, 127f / 255));
                break;

            case 2:
                Switch_Colour(new Color(125f / 255, 73f / 255, 141f / 255));
                break;

            case 3:
                Switch_Colour(new Color(205f / 255, 103f / 255, 113f / 255));
                break;

            default:
                Switch_Colour(Color.magenta);
                break;
            }
        }
        else
        {
            Switch_Colour(new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)));
        }
    }
Пример #2
0
    //refactor so it doesn't require passing vehicle

    public void Take_Health(int _amount, Vehicle_Control_Holder _firing_vehicle)
    {
        health -= _amount;
        if (health <= 0)
        {
            Game_Mode.game_mode_inst.Add_Kill(_firing_vehicle.Get_Player_Index());
            print(In_Game_Record.in_game_record_inst.Get_Highest_Kills()[0].kills);
            Die();
        }
    }