Пример #1
0
 void Start()
 {
     square.Initialize(radius * 2);
     circle.Initialize(radius);
     points = SpawnRandomPoints.SpawnRandomPointCloud(numberOfPoints, radius * 2, transform, true);
     Debug.Log("Approximation of Pi: " + ApproximatePi());
 }
Пример #2
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;
     }
 }
Пример #3
0
 void Start()
 {
     points   = SpawnRandomPoints.SpawnRandomPointCloud(numOfPoints, zoneSize, transform, false);
     centroid = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/BigRedPoint"), CalculateCentroid(), Quaternion.identity);
     SetupWanderScripts();
 }