private void swap() { if (midSwap) { if (this != toSwap) { // Perform Swap ScreenIndex temp = this.index; this.index = toSwap.index; toSwap.index = temp; toSwap.updateUI(dir, Color.black, Color.black); } else { updateUI(dir, Color.white, Color.black); } midSwap = false; } else { // Store Info for Swap toSwap = this; midSwap = true; updateUI(dir, Color.white, Color.yellow); } }
// ---------- Helper Methods ---------- private void switchFocus(CalibrationScreen toFocus) { this.active = false; if (midSwap && this == toSwap) { updateUI(dir, Color.yellow, Color.yellow); } else { updateUI(dir, Color.black, Color.black); } toFocus.setActive(dir, toSwap, midSwap); midSwap = false; }
// ---------- Setup Methods ---------- public void setup(DisplayCamera dc, CalibrationScreen nextScreen, CalibrationScreen prevScreen) { displayCam = dc; next = nextScreen; prev = prevScreen; index = (ScreenIndex)dc.cameraData.display; //Debug.Log (prev.ToString () + " > " + index.ToString () + " > " + next.ToString ()); Image[] temp = gameObject.GetComponentInChildren <GridLayoutGroup> ().GetComponentsInChildren <Image> (); foreach (Image img in temp) { switch (img.gameObject.name) { case "TopLeftMarker": controlPoints [0] = img; break; case "TopMidMarker": controlPoints [1] = img; break; case "TopRightMarker": controlPoints [2] = img; break; case "MidLeftMarker": controlPoints [7] = img; break; case "MidRightMarker": controlPoints [3] = img; break; case "BotLeftMarker": controlPoints [6] = img; break; case "BotMidMarker": controlPoints [5] = img; break; case "BotRightMarker": controlPoints [4] = img; break; } } }
public void setActive(Direction d, CalibrationScreen toSwap, bool midSwap) { buffer = false; active = true; dir = d; this.midSwap = midSwap; this.toSwap = toSwap; if (midSwap && this == toSwap) { updateUI(dir, Color.white, Color.yellow); } else { updateUI(dir, Color.white, Color.black); } //Debug.Log (prev.ToString () + " > " + index.ToString () + " > " + next.ToString ()); }