/// <summary> /// Create the dots on the circle and activate the line to link the dots to the circle /// </summary> void CreateDotOnCircle() { for (int i = 0; i < LEVEL.numberDotsOnCircle; i++) { CircleBorder.rotation = Quaternion.Euler(new Vector3(0, 0, ((float)i) * 360f / LEVEL.numberDotsOnCircle)); Transform t = SpawnDotPrefab().transform; t.position = new Vector3(0, -positionTouchBorder, 0); t.parent = CircleBorder; t.rotation = Quaternion.identity; t.gameObject.SetActive(true); DotManager dm = t.GetComponent <DotManager> (); t.GetComponent <Collider2D>().enabled = true; dm.ActivateLine(); dm.ActivateNum(false); } }
/// <summary> /// Create the dots on the circle and activate the line to link the dots to the circle /// </summary> void CreateListDots() { for (int i = 0; i < LEVEL.numberDotsToCreate; i++) { DotManager dm = SpawnDotPrefab().GetComponent <DotManager> (); dm.SetNum(i + 1); dm.ActivateNum(true); dm.GetComponent <Collider2D>().enabled = false; dm.transform.parent = CircleTransform; if (sizeDot == 0) { sizeDot = dm.DotSprite.bounds.size.x * 1.1f; } Dots.Add(dm); } }