void OnDestroy() { if (!destroyed) { VectorManager.DestroyObject(vectorLine, gameObject); } }
private void Start() { List <Vector3> vector3List = new List <Vector3>(); vector3List.Add(new Vector3(-0.5f, -0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, 0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(-0.5f, -0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, 0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, 0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(-0.5f, -0.5f, 0.5f)); vector3List.Add(new Vector3(-0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, -0.5f)); vector3List.Add(new Vector3(0.5f, -0.5f, 0.5f)); VectorManager.ObjectSetup(((Component)this).get_gameObject(), new VectorLine(((Object)((Component)this).get_gameObject()).get_name(), vector3List, 3f), (Visibility)0, (Brightness)1, false); VectorManager.useDraw3D = (__Null)1; }
void Start() { var line = new VectorLine("Shape", XrayLineData.use.shapePoints[(int)shape], XrayLineData.use.lineTexture, XrayLineData.use.lineWidth); line.color = Color.green; VectorManager.ObjectSetup(gameObject, line, Visibility.Always, Brightness.None); }
private VectorLine setupMarks(string id) { var markLength = ringRadius * ringMarkLengthFactor; var innerRad = ringRadius - markLength; var points = new List <Vector3>(); for (int i = 0; i < ringMarkCount; i++) { var angle = Mathf.Deg2Rad * markAngle * i + (Mathf.PI / 2f); var xAngle = Mathf.Cos(angle); var yAngle = Mathf.Sin(angle); var x1 = new Vector3(0, ringRadius * xAngle, ringRadius * yAngle); var x2 = new Vector3(0, innerRad * xAngle, innerRad * yAngle); var y1 = new Vector3(ringRadius * xAngle, 0, ringRadius * yAngle); var y2 = new Vector3(innerRad * xAngle, 0, innerRad * yAngle); var z1 = new Vector3(ringRadius * xAngle, ringRadius * yAngle, 0); var z2 = new Vector3(innerRad * xAngle, innerRad * yAngle, 0); points.Add(x1); points.Add(x2); points.Add(y1); points.Add(y2); points.Add(z1); points.Add(z2); } var marks = new VectorLine(id, points, markWidth); GameObject container = new GameObject(id); container.transform.parent = transform; container.transform.localPosition = Vector3.zero; VectorManager.useDraw3D = true; VectorManager.ObjectSetup(container, marks, Visibility.Always, Brightness.None); return(marks); }
void LateUpdate() { if (!VectorLine.camTransformExists) { return; } // Draw3DAuto lines for (int i = 0; i < lineCount; i++) { if (lines[i].rectTransform != null) { lines[i].Draw3D(); } else { RemoveLine(i--); } } // Only redraw static objects if camera is moving if (VectorLine.CameraHasMoved()) { VectorManager.DrawArrayLines(); } VectorLine.UpdateCameraInfo(); // Always redraw dynamic objects VectorManager.DrawArrayLines2(); }
// Token: 0x06000AF3 RID: 2803 RVA: 0x0002FE38 File Offset: 0x0002E238 private void Start() { List <Vector3> points = new List <Vector3> { new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, 0.5f) }; VectorLine line = new VectorLine(base.gameObject.name, points, 3f); VectorManager.ObjectSetup(base.gameObject, line, Visibility.Dynamic, Brightness.None, false); VectorManager.useDraw3D = true; }
public fLinesGameObject(GameObject baseGO, string name = "line") : base(baseGO, FGOFlags.EnablePreRender) { baseGO.SetName(name); // ugly... __VectrosityConfig.Configure(); if (baseGO.GetComponent <MeshFilter>() == null) { baseGO.AddComponent <MeshFilter>(); } if (baseGO.GetComponent <MeshRenderer>() == null) { baseGO.AddComponent <MeshRenderer>(); } List <Vector3> vertices = new List <Vector3>() { Vector3.zero, Vector3.one }; vectorLine = new VectorLine(name, vertices, width, LineType.Discrete); VectorManager.ObjectSetup(baseGO, vectorLine, Visibility.Dynamic, Brightness.None); }
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); }
// Use this for initialization void Start() { //initialize object this.gameObject.transform.position = new Vector3(0, 0, 1940); this.gameObject.transform.rotation = new Quaternion(90, 0, 0, 0); //initialize colors color1 = colorNormal = Manager.use.colorNormal; color2 = colorIntense = Manager.use.colorIntense; //create line "TitleBanner" line = new VectorLine(gameObject.name, LineData.use.titlePoints, Manager.use.lineWidth); line.material = Manager.use.lineMaterial; line.texture = Manager.use.lineTexture; line.color = Manager.use.colorNormal; line.capLength = Manager.use.capLength; // Make VectorManager lines be drawn in the scene instead of as an overlay VectorManager.useDraw3D = true; // Make this transform have the vector line object that's defined above // This object is a rigidbody, so the vector object will do exactly what this object does VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None); Destroy(gameObject, 8.4f); }
// Token: 0x06000AF1 RID: 2801 RVA: 0x0002FDEC File Offset: 0x0002E1EC private void Start() { List <Vector3> points = VectorLine.BytesToVector3List(this.vectorCube.bytes); VectorLine line = new VectorLine(base.gameObject.name, points, 2f); VectorManager.ObjectSetup(base.gameObject, line, Visibility.Dynamic, Brightness.None); }
private void Start() { VectorLine vectorLine = new VectorLine("Shape", XrayLineData.use.shapePoints[(int)this.shape], XrayLineData.use.lineTexture, XrayLineData.use.lineWidth); vectorLine.set_color(Color32.op_Implicit(Color.get_green())); VectorManager.ObjectSetup(((Component)this).get_gameObject(), vectorLine, (Visibility)2, (Brightness)1); }
public void StartUp() { //Set up target reticle lines and colors... //set reticle up 1.7 meters to match player's offset from zero //set reticle distance to just inside far clip plane defaultPosZ = 1860f; this.gameObject.transform.position = new Vector3(0, 1.7f, defaultPosZ); this.gameObject.transform.rotation = new Quaternion(0, 0, 0, 0); //scale reticle for (int index = 0; index < LineData.use.reticlePoints.Count; index++) { Vector3 point = LineData.use.reticlePoints[index]; point = point * this.reticleScale; LineData.use.reticlePoints[index] = point; } //Create reticle Reticle = new VectorLine(gameObject.name, LineData.use.reticlePoints, Manager.use.lineWidth); Reticle.material = Manager.use.lineMaterial; Reticle.texture = Manager.use.lineTexture; Reticle.color = Manager.use.colorNormal; Reticle.capLength = Manager.use.capLength; // Make VectorManager lines be drawn in the scene instead of as an overlay VectorManager.useDraw3D = true; // Make this transform have the vector line object that's defined above VectorManager.ObjectSetup(gameObject, Reticle, Visibility.Dynamic, Brightness.None); }
void LateUpdate() { if (!Vector.camTransformExists) { return; } // Only redraw if camera is moving if (Vector.oldPosition != Vector.camTransformPosition || Vector.oldRotation != Vector.camTransformEulerAngles) { for (int i = 0; i < lineCount; i++) { if (lines[i].vectorObject != null) { Vector.DrawLine3D(lines[i], transforms[i]); } else { RemoveLine(i--); } } VectorManager.DrawArrayLines(); } Vector.oldPosition = Vector.camTransformPosition; Vector.oldRotation = Vector.camTransformEulerAngles; // Always redraw dynamic objects VectorManager.DrawArrayLines2(); }
void OnDestroy() { if (m_destroyed) { return; // Paranoia check } m_destroyed = true; VectorManager.VisibilityStaticRemove(m_objectNumber.i); VectorLine.Destroy(ref m_vectorLine); }
public void OnEnable() { vectorLine = new VectorLine(gameObject.name, linePoints, lineTexture, 10f); vectorLine.color = new Color(lineColor.r, lineColor.g, lineColor.b); Debug.Log("enable:" + gameObject.name + lineColor.ToString()); VectorManager.ObjectSetup(gameObject, vectorLine, Visibility.Dynamic, Brightness.None, false); // Make VectorManager lines be drawn in the scene instead of as an overlay VectorManager.useDraw3D = true; }
void OnDestroy() { if (destroyed) { return; // Paranoia check } destroyed = true; VectorManager.VisibilityRemove(m_objectNumber.i); Vector.DestroyLine(ref vectorLine); }
// Use this for initialization void Start() { renderer.enabled = true; VectorLine VLine = new VectorLine("Lines", renderlines, null, 2); VLine.color = Color.green; VectorManager VMan = new VectorManager(); VectorManager.ObjectSetup(gameObject, VLine, Visibility.Static, Brightness.Fog, true); }
public void Setup(VectorLine line, bool makeBounds) { if (makeBounds) { VectorManager.SetupBoundsMesh(gameObject, line); } VectorManager.VisibilitySetup(transform, line, out m_objectNumber); vectorLine = line; }
// 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; } vectorLine.active = true; }
public void Setup(VectorLine line, bool m_useLine) { m_objectNumber = new RefInt(0); VectorManager.CheckDistanceSetup(transform, line, line.color, m_objectNumber); VectorManager.SetDistanceColor(m_objectNumber.i); if (m_useLine) // Only if there are no Visibility scripts being used { this.m_useLine = true; m_vectorLine = line; } }
//private bool collided; public virtual void Start() { // Set the initial brightness based on distance from player...we're not using fog since that interferes with the fading we do in FadeOut //fwe181230 this.initialColor = Manager.use.MultiplyColor(Manager.use.normalColor, (float) VectorManager.GetBrightnessValue(this.transform.position)); this.initialColor = Manager.use.colorNormal; this.line.SetColor(this.initialColor); VectorManager.useDraw3D = true; VectorManager.ObjectSetup(this.gameObject, this.line, Visibility.Dynamic, Brightness.None); this.objectNumber = Manager.use.ArrayAdd(this.transform, Manager.use.objects); //fwe181230 Physics.IgnoreCollision((Collider) this.GetComponent(typeof(Collider)), Manager.playerCollider); this.InvokeRepeating("FadeOut", 0.2f, 0.2f); }
void Start() { // Make a Vector3 array from the data stored in the vectorCube text asset // Try using different assets from the Vectors folder for different shapes (the collider will still be a cube though!) var cubePoints = VectorLine.BytesToVector3List(vectorCube.bytes); // Make a line using the above points, with a width of 2 pixels var line = new VectorLine(gameObject.name, cubePoints, 2.0f); // Make this transform have the vector line object that's defined above // This object is a rigidbody, so the vector object will do exactly what this object does VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None); }
void OnDestroy() { if (destroyed) { return; // Paranoia check } destroyed = true; VectorManager.DistanceRemove(m_objectNumber.i); if (useLine) { Vector.DestroyLine(ref vectorLine); } }
public void Setup(VectorLine line, bool makeBounds) { if (makeBounds) { VectorManager.SetupBoundsMesh(gameObject, line); } VectorManager.VisibilitySetup(transform, line, out m_objectNumber); m_vectorLine = line; if (GetComponent <Renderer>().isVisible) { OnBecameVisible(); } }
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 (!GetComponent <Renderer>().isVisible) { m_vectorLine.active = false; } }
void Start() { // Make a Vector3 array that contains points for a cube that's 1 unit in size var cubePoints = new List <Vector3> { new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, 0.5f) }; // Make a line using the above points, with a width of 2 pixels var line = new VectorLine(gameObject.name, cubePoints, 2.0f); // Make this transform have the vector line object that's defined above // This object is a rigidbody, so the vector object will do exactly what this object does VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None); }
private void setupRing(string id, Vector3 upVector) { var ring = new VectorLine(id, new List <Vector3>(ringVertices), ringWidth, LineType.Continuous, Joins.Weld); ring.material = lineMaterial; ring.MakeCircle(Vector3.zero, upVector, ringRadius); // ring.Draw3DAuto(); GameObject container = new GameObject(id); container.transform.parent = transform; container.transform.localPosition = Vector3.zero; VectorManager.useDraw3D = true; VectorManager.ObjectSetup(container, ring, Visibility.Always, Brightness.None); }
public void Setup(VectorLine line, bool useLine) { if (line.lineColors == null) { Debug.LogError("In order to use Brightness.Fog, the line \"" + line.vectorObject.name + "\" must contain segment colors"); return; } m_objectNumber = new RefInt(0); VectorManager.CheckDistanceSetup(transform, line, line.lineColors[0], m_objectNumber); VectorManager.SetDistanceColor(m_objectNumber.i); if (useLine) // Only if there are no Visibility scripts being used { this.useLine = true; vectorLine = line; } }
public static Point3D RotateAboutAxis(this Point3D u, Point3D axis, double angle) { var angleInRadians = angle * (Math.PI / 180); var normalAxis = VectorManager.Normalize(axis); var projection = u.Project(axis); var orthogonalProjection = u.OrthogonalProject(axis); var normalAxisCrossOrthogProjection = VectorManager.Cross(normalAxis, orthogonalProjection); var rotatedProjection = VectorManager.Scale(normalAxisCrossOrthogProjection, Math.Sin(angleInRadians)) + VectorManager.Scale(orthogonalProjection, Math.Cos(angleInRadians)); return(rotatedProjection + projection); }
void Start() { // Make a Vector3 array that contains points for a cube that's 1 unit in size var cubePoints = new List <Vector3> { new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, -0.5f), new Vector3(0.5f, -0.5f, 0.5f) }; // Make a line using the above points, with a width of 3 pixels var line = new VectorLine(gameObject.name, cubePoints, 3.0f); // Make VectorManager lines be drawn in the scene instead of as an overlay VectorManager.useDraw3D = true; // Make this transform have the vector line object that's defined above // This object is a rigidbody, so the vector object will do exactly what this object does // "false" is added at the end, so that the cube mesh is not replaced by an invisible bounds mesh VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None, false); }
void OnApplicationQuit() { s_Use = null; }