<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterBarController : MonoBehaviour {
    float Health_percentage;
    float Ult_percentage;
    float Win_percentage;
    float HPconstant1 = -24.4f;
    float HPconstant2 = 77.6f;
    float Ultconstant1 = -35.2f;
    float Ultconstant2 = 80f;
    float Winconstant1 = -19.1f;
    float Winconstant2 = 74.6f;
    Vector3 HealthBarLocalTransform;
    Vector3 UltBarLocalTransform;
    Vector3 WinBarLocalTransform;

    public GameObject Health_bar;
    public GameObject Ult_bar;
    public GameObject Win_bar;

    public float MaxHP = 1000;
    GameObject character;
    CharacterControll CC;

	// Use this for initialization
	void Start () {
        //  0<= percentage <=1
        Health_percentage = 1;
        Ult_percentage = 0;
        Win_percentage = 0;
        CC = character.GetComponent<CharacterControll>();
        Health_percentage = CC.hp / MaxHP;
        Debug.Log(CC.hp);


    }
	
	// Update is called once per frame
	void Update () {
        GuageControl(Health_bar, Health_percentage, HPconstant1, HPconstant2);
        GuageControl(Ult_bar, Ult_percentage, Ultconstant1, Ultconstant2);
        GuageControl(Win_bar, Win_percentage, Winconstant1, Winconstant2);
        //Health_percentage = CC.hp / MaxHP;
        //Debug.Log(CC.hp);
        //Ult_percentage += Time.deltaTime / 30;
        //Win_percentage += Time.deltaTime / 30;
    }

    void GuageControl(GameObject bar, float percentage, float constant1, float constant2)
    {

        Vector3 barScale = bar.transform.localScale;
        barScale.x = percentage;
        bar.transform.localScale = barScale;<commit_msg>minor fix<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterBarController : MonoBehaviour {
    float Health_percentage;
    float Ult_percentage;
    float Win_percentage;
    float HPconstant1 = -24.4f;
    float HPconstant2 = 77.6f;
    float Ultconstant1 = -35.2f;
    float Ultconstant2 = 80f;
    float Winconstant1 = -19.1f;
    float Winconstant2 = 74.6f;
    Vector3 HealthBarLocalTransform;
    Vector3 UltBarLocalTransform;
    Vector3 WinBarLocalTransform;

    public GameObject Health_bar;
    public GameObject Ult_bar;
    public GameObject Win_bar;

    public float MaxHP = 1000;
    public GameObject character;
    CharacterControll CC;

	// Use this for initialization
	void Start () {
        //  0<= percentage <=1
        Health_percentage = 1;
        Ult_percentage = 0;
        Win_percentage = 0;
        CC = character.GetComponent<CharacterControll>();
        Health_percentage = CC.hp / MaxHP;
        Debug.Log(CC.hp);


    }
	
	// Update is called once per frame
	void Update () {
        GuageControl(Health_bar, Health_percentage, HPconstant1, HPconstant2);
        GuageControl(Ult_bar, Ult_percentage, Ultconstant1, Ultconstant2);
        GuageControl(Win_bar, Win_percentage, Winconstant1, Winconstant2);
        Health_percentage = CC.hp / MaxHP;
        Debug.Log(CC.hp);
        //Ult_percentage += Time.deltaTime / 30;
        //Win_percentage += Time.deltaTime / 30;
    }

    void GuageControl(GameObject bar, float percentage, float constant1, float constant2)
    {

        Vector3 barScale = bar.transform.localScale;
        barScale.x = percentage;
        bar.transform.localScale = barScale;
{'fraction_non_alphanumeric': 0.08467153284671533, 'fraction_numerical': 0.02802919708029197, 'mean_word_length': 2.9064994298745725, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4319142', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1007, 'n_words': 249}