Beispiel #1
0
    private IEnumerator c_actionTime(string _function, string[] _data)
    {
        yield return(new WaitForSeconds(1.0f));

        switch (v_timeToAction)
        {
        case 1:
        {
            v_point.GetComponent <MeshRenderer>().material.color = Color.green;
        }
        break;

        case 2:
        {
            v_point.GetComponent <MeshRenderer>().material.color = Color.yellow;
        }
        break;

        case 3:
        {
            v_point.GetComponent <MeshRenderer>().material.color = Color.red;
        }
        break;

        default:
            break;
        }
        ;

        if (v_timeToAction > 0)
        {
            v_timeToAction--;
        }

        if (v_timeToAction == 0 && v_Active == false)
        {
            Debug.Log("Action");
            v_Active = true;
            EventFn.LoadFunctions(_function, _data);
        }

        StartCoroutine(c_actionTime(_function, _data));
    }
Beispiel #2
0
 void Awake()
 {
     instance = this;
 }