コード例 #1
0
 public void SetActiveCar()
 {
     for(int i=0; i< Cars.Length; i++)
     {
         Cars[i].SetActive(false);
     }
     Cars[carIdx].SetActive(true);
     currentCar = (IVehicleTitleUI)Cars[carIdx].GetComponentInChildren(typeof(IVehicleTitleUI));
     UpdateCarDescAndItems_VSelectScreen(currentCar);
 }
コード例 #2
0
 public void SetActiveCar()
 {
     for (int i = 0; i < Cars.Length; i++)
     {
         Cars[i].SetActive(false);
     }
     Cars[carIdx].SetActive(true);
     currentCar = (IVehicleTitleUI)Cars[carIdx].GetComponentInChildren(typeof(IVehicleTitleUI));
     UpdateCarDescAndItems_VSelectScreen(currentCar);
 }
コード例 #3
0
    public void UpdateCarDescAndItems_VSelectScreen(IVehicleTitleUI currentCar)
    {
        StopTypeWriter();
        txtVehicleDesc.GetComponent<UILabel>().text = currentCar.Description;
        descripText = currentCar.Description;
        txtVehicleName.GetComponent<UILabel>().text = currentCar.Name;
        StartTypeWriter();

        items[0].spriteName = itemLbls[0].text = currentCar.Item1;
        items[1].spriteName = itemLbls[1].text = currentCar.Item2;
        items[2].spriteName = itemLbls[2].text = currentCar.Item3;
    }
コード例 #4
0
    public void UpdateCarDescAndItems_VSelectScreen(IVehicleTitleUI currentCar)
    {
        StopTypeWriter();
        txtVehicleDesc.GetComponent <UILabel>().text = currentCar.Description;
        descripText = currentCar.Description;
        txtVehicleName.GetComponent <UILabel>().text = currentCar.Name;
        StartTypeWriter();

        items[0].spriteName = itemLbls[0].text = currentCar.Item1;
        items[1].spriteName = itemLbls[1].text = currentCar.Item2;
        items[2].spriteName = itemLbls[2].text = currentCar.Item3;
    }
コード例 #5
0
    public void UpdateStatBars_VSelectScreen(IVehicleTitleUI currentCar)
    {
        handling.value = Mathf.Lerp(handling.value, Mathf.Clamp(currentCar.Handling, 0, 1), 0.1f);
        handling.foregroundWidget.color = Color.Lerp(Color.red, Color.green, handling.value);

        speed.value = Mathf.Lerp(speed.value, Mathf.Clamp(currentCar.Speed, 0, 1), 0.1f);
        speed.foregroundWidget.color = Color.Lerp(Color.red, Color.green, speed.value);

        accel.value = Mathf.Lerp(accel.value, Mathf.Clamp(currentCar.Accel, 0, 1), 0.1f);
        accel.foregroundWidget.color = Color.Lerp(Color.red, Color.green, accel.value);

        boost.value = Mathf.Lerp(boost.value, Mathf.Clamp(currentCar.Boost, 0, 1), 0.1f);
        boost.foregroundWidget.color = Color.Lerp(Color.red, Color.green, boost.value);
    }
コード例 #6
0
    UILabel[] itemLbls = new UILabel[3];                                    //images for items
    void Start()
    {
        items[0] = GameObject.Find("Item0").GetComponent <UISprite>();
        items[1] = GameObject.Find("Item1").GetComponent <UISprite>();
        items[2] = GameObject.Find("Item2").GetComponent <UISprite>();

        itemLbls[0] = GameObject.Find("lblItem1").GetComponent <UILabel>();
        itemLbls[1] = GameObject.Find("lblItem2").GetComponent <UILabel>();
        itemLbls[2] = GameObject.Find("lblItem3").GetComponent <UILabel>();

        handling       = GameObject.Find("handling").GetComponent <UISlider>();
        speed          = GameObject.Find("speed").GetComponent <UISlider>();
        accel          = GameObject.Find("accel").GetComponent <UISlider>();
        boost          = GameObject.Find("boost").GetComponent <UISlider>();
        txtVehicleDesc = GameObject.Find("txtVehicleDesc");
        txtVehicleName = GameObject.Find("txtVehicleName");

        currentCar = (IVehicleTitleUI)Cars[carIdx].GetComponentInChildren(typeof(IVehicleTitleUI));
        SetActiveCar();

        UpdateCarDescAndItems_VSelectScreen(currentCar);
        txtVehicleDesc.GetComponent <UILabel>().text = "";
    }
コード例 #7
0
    public void UpdateStatBars_VSelectScreen(IVehicleTitleUI currentCar)
    {
        handling.value =  Mathf.Lerp(handling.value,Mathf.Clamp(currentCar.Handling,0,1),0.1f);
        handling.foregroundWidget.color = Color.Lerp(Color.red,Color.green,handling.value);

        speed.value =  Mathf.Lerp(speed.value,Mathf.Clamp(currentCar.Speed,0,1),0.1f);
        speed.foregroundWidget.color = Color.Lerp(Color.red,Color.green,speed.value);

        accel.value =  Mathf.Lerp(accel.value,Mathf.Clamp(currentCar.Accel,0,1),0.1f);
        accel.foregroundWidget.color = Color.Lerp(Color.red,Color.green,accel.value);

        boost.value =  Mathf.Lerp(boost.value,Mathf.Clamp(currentCar.Boost,0,1),0.1f);
        boost.foregroundWidget.color = Color.Lerp(Color.red,Color.green,boost.value);
    }
コード例 #8
0
    void Start()
    {
        items[0] 		= GameObject.Find("Item0").GetComponent<UISprite>();
        items[1] 		= GameObject.Find("Item1").GetComponent<UISprite>();
        items[2] 		= GameObject.Find("Item2").GetComponent<UISprite>();

        itemLbls[0] 		= GameObject.Find("lblItem1").GetComponent<UILabel>();
        itemLbls[1] 		= GameObject.Find("lblItem2").GetComponent<UILabel>();
        itemLbls[2] 		= GameObject.Find("lblItem3").GetComponent<UILabel>();

        handling 		= GameObject.Find("handling").GetComponent<UISlider>();
        speed 			= GameObject.Find("speed").GetComponent<UISlider>();
        accel 			= GameObject.Find("accel").GetComponent<UISlider>();
        boost			= GameObject.Find("boost").GetComponent<UISlider>();
        txtVehicleDesc 	= GameObject.Find("txtVehicleDesc");
        txtVehicleName 	= GameObject.Find("txtVehicleName");

        currentCar 		= (IVehicleTitleUI)Cars[carIdx].GetComponentInChildren(typeof(IVehicleTitleUI));
        SetActiveCar();

        UpdateCarDescAndItems_VSelectScreen(currentCar);
        txtVehicleDesc.GetComponent<UILabel>().text = "";
    }