void OnBecameVisible() { Vector.Active(vectorLine, true); // Draw line now, otherwise's there's a 1-frame delay before the line is actually drawn in the next LateUpdate VectorManager.DrawArrayLine2(m_objectNumber.i); }
private void UpdateLineCache() { int oldLength = mLines.Count; int newLength = mEdges.Count; for (int i = newLength; i < oldLength; i++) { VectorLine line = mLines[i]; Vector.DestroyLine(ref line); } if (newLength < oldLength) { mLines.RemoveRange(newLength, oldLength - newLength); } HashSet <TypedEdge <ISatellite> > .Enumerator it = mEdges.GetEnumerator(); for (int i = 0; i < newLength; i++) { it.MoveNext(); var newPoints = new Vector3[] { ScaledSpace.LocalToScaledSpace(it.Current.A.Position), ScaledSpace.LocalToScaledSpace(it.Current.B.Position) }; AssignVectorLine(i, newPoints, it.Current); Vector.Active(mLines[i], CheckVisibility(it.Current)); } }
public void OnBecameInvisible() { if (!useLine) { return; } Vector.Active(vectorLine, false); }
// Force the color to be set when becoming visible void OnBecameVisible() { VectorManager.SetOldDistance(m_objectNumber.i, -1); VectorManager.SetDistanceColor(m_objectNumber.i); if (!useLine) { return; } Vector.Active(vectorLine, true); }
IEnumerator WaitCheck() { // Ensure that the line is drawn once even if the camera isn't moving // Otherwise this object would be invisible until the camera moves // However, the camera might not have been set up yet, so wait a frame and turn off if necessary VectorManager.DrawArrayLine(m_objectNumber.i); yield return(null); if (!renderer.isVisible) { Vector.Active(vectorLine, false); } }
void OnBecameInvisible() { Vector.Active(vectorLine, false); }