Example #1
0
    void Update()
    {
        if (currentDriver != previousDriver)
        {
            previousDriver = currentDriver;
            UpdateCurrentDriver(currentDriver.ToString());

        }
    }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        if (driverList.Count <= 0)
        {
            LoadAllDrivers();
        }

        UpdateCurrentDriver(currentDriver.ToString());
        previousDriver = currentDriver;
    }
Example #3
0
    public void UpdateCurrentDriver(string newDriver)
    {
        currentDriver = (KartDrivers) Enum.Parse(typeof(KartDrivers), newDriver);
        foreach (GameObject driver in driverList)
        {
            if (!driver.name.ToLower().Contains(newDriver.ToLower()))
            {
                driver.SetActive(false);
            }
            else
            {
                driver.SetActive(true);
            }

        }
    }