Use Gizmos Of DrawLine How to draw a line .

First, find the coordinates of the five fixed points of the pentagram in the scene , Name it... In the order of one stroke 1,2,3,4,5, As shown in the figure :

The next step is to write the code , There's very little code , As shown below :

using UnityEngine;
using System.Collections; public class fiveStars : MonoBehaviour { public Transform[] fivePoints = new Transform[5];
// Use this for initialization
void Start () {
} // Update is called once per frame
void Update () { } void OnDrawGizmos()
{
Gizmos.color = Color.red;
for (int i = 1; i < fivePoints.Length; i++)
{
Gizmos.DrawLine(fivePoints[i-1].position, fivePoints[i].position);
}
Gizmos.DrawLine(fivePoints[4].position, fivePoints[0].position);
}
}

The final rendering is as follows :

stay unity Of scene More articles about drawing five pointed stars in Chinese

  1. Unity Making scenes in the game

    Unity Making scenes in the game 1.2.3   scene stay Unity in , scene (Scene) When game developers make games , Game scenarios used . It's a three-dimensional space , The corresponding three-dimensional axes are X Axis .Y Axis and Z This article is selected from Unity ...

  2. python Draw a scatter diagram in Chinese

    python Draw a scatter diagram in Chinese Sample code : import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d impor ...

  3. Use fonts to draw... In the web page Icon Icon

    First step , download .IcoMoon The website selects the font icon and downloads , After decompression fonts The folder is in the project directory .fonts There are four font files in the folder : notes : Because the browser's support for each font is inconsistent , To show it in all browsers ...

  4. The font is drawn in the web page ICON Icon

    Use fonts to draw... In the web page ICON There are three tips for icons : 1. use CSS Sprite Draw small icons in the web page Implementation method : First, integrate the small picture into a large picture And then according to the position of the specific icon on the big picture , Position the background .background- ...

  5. DDD~Unity stay DDD The use of

    Back to directory The last lecture introduced DDD The domain layer in , And mentioned that next time we will talk about Unity, So of course this article will introduce it , ha-ha ,Unity yes Microsoft.Practices Part of , It mainly implements the function of dependency injection , Or call it control ...

  6. stay ps Draw two concentric circles and cut them at any angle

    Meet in the work, to be in ps Draw two concentric circles as shown in the picture , And carry out 6 Equal division . Search information and explore by yourself , This can be achieved by : 1. Create a new canvas . And draw two horizontal and vertical reference lines with a ruler , Select the Ellipse Tool , And select the circle and from the center in the option settings ...

  7. Unity3D take Unity The embedded WPF Some research notes in

      One . stay  WPF Use in WebBrowser, Open it directly WebPlayer.html One problem in this way is . Cannot be in WebBrowser On top of Place other controls , At run time , It doesn't show . With ...

  8. 【Unity Game development 】 Talking about Unity Unit testing in game development

    One . The definition and function of unit testing Unit test definition : Unit testing is a very important tool in traditional software development , It means checking and verifying the smallest testable unit in software , In general, it is to verify a function in the code , Check its correctness . A unit test ...

  9. Unity Common problems in the process of project development , Have you ever met ?

    Recently I saw a friend ask unity The game development team , What kind of knowledge do you need to master . in fact Unity The engine is a very flexible engine , Depending on the type of game the team develops , There are also differences in personnel requirements , So we can't generalize . however , Some are Unit ...

Random recommendation

  1. JVM New notes

    JVM Concept JVM yes Java Virtual Machine(Java virtual machine ) Abbreviation ,JVM Is a specification for computing equipment , It's an imaginary computer , It is realized by simulating various computer functions on a real computer . ...

  2. jsp Entry notes

    jsp grammar 1. declaration Because of the visit serlvet only one ,<%! int i = 0; %>   yes servlet The variable of , It's constantly increasing when it's refreshed <% int i = 0; ...

  3. [ACM_ other ] Modular Inverse [a About the mould m The inverse of Modular linear equation ]

    Description The modular modular multiplicative inverse of an integer a modulo m is an integer x such ...

  4. Heritrix Source code analysis ( 11、 ... and ) Heritrix Medium URL--CandidateURI and CrawlURI And how to add your own attributes ( turn )

    This blog is an original article , Welcome to reprint ! Please indicate the source of reprint :http://guoyunsky.iteye.com/blog/649889 This blog has been transferred to my independent blog : http://www.yun5u.com/ ...

  5. use handle Message mechanism to achieve the effect of carousel

    // Auto carousel display if (mhandle == null) { mhandle = new Handler() { public void handleMessage(Message mes) { ...

  6. Prefix.pch Function and usage of

    It's usually used to place macros , Omit xcode Compile time Hello World_Prefix.pch: Extension .pch Express "precompiled header", This is a project you need to use from the outside ...

  7. JS A countdown timer , Review by the way javascript Time correlation function

    window.onload = function(){ var uS = 604800; // Background offering : second var day=hour=minute=second=0, timer; var dem ...

  8. test MarsEdit

    test MarsEdit In today's MAC Upper use MarsEdit Write the first blog , Test use . In today's MAC Upper use MarsEdit Write the first blog , Test use . -(void)myBtnAction:(UIButto ...

  9. use node.js Realization ORM A way of thinking

    ORM yes O and R Mapping .O Represents object-oriented ,R Represents a relational database . The two have similarities, but also have their own characteristics . It is because of this situation that is both right and wrong , You need to do the mapping . Ideally , According to the relational database ( Including business needs ) The characteristics of the database design . meanwhile ...

  10. Hibernate introduction ---- The configuration file

    One .Hibernate brief introduction hibernate It's an open source , Lightweight , Lasting success ORM frame . Hibernate Is an open source object relational mapping framework , It's right JDBC Very lightweight object encapsulation , It will POJO And number ...