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