Пример #1
0
 void Start()
 {
     mainPoint = SpawnRandomPoints.SpawnRandomPoint(zoneSize, false);
     mainPoint.transform.localScale *= 4;
     mainPoint.GetComponent <Renderer>().material.color = Color.green;
     points = SpawnRandomPoints.SpawnRandomPointCloud(numOfPoints, zoneSize, transform, false);
     if (ReturnNearestPoint() != null)
     {
         GameObject nearestPoint = ReturnNearestPoint().gameObject;
         nearestPoint.GetComponent <Renderer>().material.color = Color.red;
     }
 }
    void Start()
    {
        A             = SpawnRandomPoints.SpawnRandomPoint(sizeOfArea, true).transform;
        B             = SpawnRandomPoints.SpawnRandomPoint(sizeOfArea, true).transform;
        C             = SpawnRandomPoints.SpawnRandomPoint(sizeOfArea, true).transform;
        A.localScale *= 2;
        B.localScale *= 2;
        C.localScale *= 3;
        LineRenderer rend = GetComponent <LineRenderer>();

        rend.SetPosition(0, 100 * (A.position - B.position) + A.position);
        rend.SetPosition(1, -100 * (A.position - B.position) + A.position);
        cRend = C.gameObject.GetComponent <Renderer>();
        cRend.material.color = Color.red;
    }