/// <summary> /// Determines which holographic diagram is counted by the docking zone. /// </summary> /// <param name="feynmanBox"></param> private void ChangeChosenDiagram(MAIAHologramDiagram feynmanBox) { feynmanBox.screenRenderer.material = _whiteShader; feynmanBox.displayLine = false; Texture diagram = feynmanBox.contentRenderer.material.mainTexture; _tablet.selectedDiagram = diagram; }
void OnTriggerEnter(Collider other) { if (other.tag == "Feynmanbox") { MAIAHologramDiagram feynmanBox = other.GetComponent <MAIAHologramDiagram>(); _diagrams.Add(feynmanBox); ChangeChosenDiagram(feynmanBox); } }
private void OnTriggerExit(Collider other) { if (other.tag == "Feynmanbox") { MAIAHologramDiagram feynmanBox = other.GetComponent <MAIAHologramDiagram>(); _diagrams.Remove(feynmanBox); feynmanBox.screenRenderer.material = _blueShader; feynmanBox.displayLine = true; if (_diagrams.Count != 0) { ChangeChosenDiagram(_diagrams[0]); } } }
private void LateUpdate() { if (gameObject.activeInHierarchy && _lines != null && _diagrams != null) { for (int i = 0; i < _lines.Length && i < _diagrams.Length; i++) { MAIAHologramDiagram diagram = _diagrams[i]; if (diagram.anchorPoint.position != _previousPositions[i]) { SetPositions(_lines[i], _originPoint.position, diagram.anchorPoint.position); _previousPositions[i] = diagram.anchorPoint.position; _lines[i].gameObject.SetActive(diagram.displayLine); } } } }