Esempio n. 1
0
    public void SetSlidersOnOpen()
    {
        Slider slider;

        StatPack.StatType type;
        type         = StatPack.StatType.Acceleration;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.Armor;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.Grip;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.Health;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.Nitro;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.TopSpeed;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        type         = StatPack.StatType.Weight;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));

        damageSliders.SetSliders();
    }
Esempio n. 2
0
    public void SetSlidersOnNewEquip()
    {
        Slider slider;

        StatPack.StatType type;
        type         = StatPack.StatType.Acceleration;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.Armor;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.Grip;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.Health;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.Nitro;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.TopSpeed;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);
        type         = StatPack.StatType.Weight;
        slider       = PickSlider(type);
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), GarageStats.CurrentStatValue(type));
        slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 1, 0.3f);

        damageSliders.SetSliders();
    }
Esempio n. 3
0
    public void ShowStatBars(StatPack pack, StatPack otherPack)
    {
        Slider   slider;
        StatPack newStats;

        StatPack.StatType type;
        StatPack          currentStats = GarageStats.currentStats;

        newStats = StatPack.Instead(GarageStats.currentStats, otherPack, pack);

        type   = StatPack.StatType.Acceleration;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.Armor;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.Grip;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.Health;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.Nitro;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.TopSpeed;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));

        type   = StatPack.StatType.Weight;
        slider = PickSlider(type);
        if (newStats.GetAdd(type) > currentStats.GetAdd(type) + 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(0, 1, 0, 0.3f);
        }
        if (newStats.GetAdd(type) < currentStats.GetAdd(type) - 0.00001f)
        {
            slider.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = new Color(1, 0, 0, 0.3f);
        }
        slider.value = SliderPosition(GarageStats.MinStatValue(type), GarageStats.MaxStatValue(type), newStats.GetAdd(type));
    }