System.Collections.Generic.List.Add(libraryPanel)

Here are the examples of the csharp api System.Collections.Generic.List.Add(libraryPanel) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : panelRingComponentInterface.cs
License : Apache License 2.0
Project Creator : googlearchive

public void loadPanels(float pR) {
    transform.localRotation = Quaternion.idenreplacedy;

    panelRadius = pR;
    for (int i = 0; i < panelMax; i++) {
      GameObject g = Instantiate(panelPrefab, transform, false) as GameObject;
      Quaternion q = Quaternion.Euler(180f / panelMax * (i - panelMax / 2) + 90f / panelMax, 0, 0);
      g.transform.localPosition = q * Vector3.forward * panelRadius;
      g.transform.localRotation = q;
      panels.Add(g.GetComponent<libraryPanel>());

      if (i < labels.Count) {
        panels.Last().Setup(transform.parent, panelRadius, i, labels[i], secondary);
      } else {
        panels.Last().Setup(transform.parent, panelRadius, i, "", secondary);
        panels.Last().SetActive(false);
      }
    }

    float offset = Mathf.Clamp(labels.Count, 0, panelMax) / (float)panelMax;
    transform.localRotation = Quaternion.Euler(90 * (1 - offset), 0, 0);
  }

19 View Source File : panelRingComponentInterface.cs
License : Apache License 2.0
Project Creator : googlearchive

public bool requestNewID(libraryPanel l, int oldID, int dir, out Vector3 pos, out Quaternion rot) {
    int newID = oldID;
    if (dir > 0) {
      panels.RemoveAt(panels.Count - 1);
      newID = panels.First().buttonID - dir;
      panels.Insert(0, l);
    } else if (dir < 0) {
      panels.RemoveAt(0);
      newID = panels.Last().buttonID - dir;
      panels.Add(l);
    }

    rot = Quaternion.Euler(180f / panelMax * (newID - panelMax / 2) + 90f / panelMax, 0, 0);
    pos = rot * Vector3.forward * panelRadius;

    _deviceInterface.spinLocks[0] = newID < -panelMax / 2; ;
    _deviceInterface.spinLocks[1] = newID > labels.Count + panelMax / 2; ;

    if (newID < 0 || newID >= labels.Count) {
      l.setNewID(newID, "");
      return false;
    } else {
      l.setNewID(newID, labels[newID], newID == curSelect);
      return true;
    }
  }