Search Unity

error code CS1624

Discussion in 'Vuforia' started by andspire7, Dec 25, 2019.

  1. andspire7

    andspire7

    Joined:
    May 9, 2019
    Posts:
    1
    I am hope any can help me, I am trying to connect two database mysql, but i keep getting erro code CS1624. "The body of 'connect.Update()' cannot be an iterator block because 'void' is not an iterator interface type"

    Code (CSharp):
    1. void Update()
    2.          {
    3.              StateManager sm = TrackerManager.Instance.GetStateManager();
    4.              IEnumerable<TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();
    5.              foreach (TrackableBehaviour tb in tbs)
    6.              {
    7.                  string name = tb.TrackableName;
    8.                  ImageTarget it = tb.Trackable as ImageTarget;
    9.                  Vector2 size = it.GetSize();
    10.                  Debug.Log("Active image target:" + name + "  -size: " + size.x + ", " + size.y);
    11.            
    12.                  FCanvas.gameObject.SetActive(false);
    13.                  canvas.gameObject.SetActive(true);
    14.                  bttonback.gameObject.SetActive(true);
    15.                  if (name == "BarcodeMK")
    16.                  {
    17.                      WWW itemsData = new WWW("http://192.168.43.15/unitydb/tampilmesin.php");
    18.                      yield return itemsData;
    19.                      string itemsDataString = itemsData.text;
    20.                      Debug.Log ("DATA: "+itemsDataString);
    21.                      items = itemsDataString.Split(';');
    22.                  
    23.                      Title.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Nama:");
    24.                      Lotnumber.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Lot Number:");
    25.                      Operator.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Operator:");
    26.                      Counter.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Counter:");
    27.                      cboil.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "cb_oil_change:");
    28.                      gearoil.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "gear_oil_change:");
    29.                      tuc.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "tuc_unit:");
    30.                      totcle.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "total_clearance:");
    31.                      solv.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "sol_valve:");
    32.                      electrical.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "electrical:");
    33.                  }
    34.                  if (name == "2BarcodeMK")
    35.                  {
    36.                      WWW itemsData = new WWW("http://192.168.43.15/unitydb/tampilmesin2.php");
    37.                      yield return itemsData;
    38.                      string itemsDataString = itemsData.text;
    39.                      Debug.Log ("DATA: "+itemsDataString);
    40.                      items = itemsDataString.Split(';');
    41.                    
    42.                      Title.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Nama:");
    43.                      Lotnumber.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Lot Number:");
    44.                      Operator.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Operator:");
    45.                      Counter.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "Counter:");
    46.                      cboil.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "cb_oil_change:");
    47.                      gearoil.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "gear_oil_change:");
    48.                      tuc.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "tuc_unit:");
    49.                      totcle.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "total_clearance:");
    50.                      solv.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "sol_valve:");
    51.                      electrical.GetComponent<UnityEngine.UI.Text>().text = GetDataValue(items[0], "electrical:");
    52.                  }
    53.                    
    54.                  string GetDataValue(string data, string index)
    55.                  {
    56.                      string value = data.Substring(data.IndexOf(index)+index.Length);
    57.                      if(value.Contains("|"))value = value.Remove(value.IndexOf("|"));
    58.                      return value;
    59.                  }
    60.              }
    61.          }