using System;
using UnityEngine;

// Token: 0x0200009E RID: 158
public class CreateCircle : MonoBehaviour
{
	// Token: 0x06000EAC RID: 3756 RVA: 0x001178D0 File Offset: 0x00115AD0
	public GameObject CreateSphere(Vector3 position, float size)
	{
		GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Capsule);
		gameObject.transform.parent = Links.x.gameplay.transform;
		gameObject.transform.position = position;
		gameObject.transform.localScale = new Vector3(size, size, size);
		Object.Destroy(gameObject.GetComponent<SphereCollider>());
		gameObject.layer = 2;
		return gameObject;
	}

	// Token: 0x06000EAD RID: 3757 RVA: 0x00117930 File Offset: 0x00115B30
	private void Start()
	{
		for (int i = 0; i < this.numberOfObjects; i++)
		{
			float num = (float)i * 3.1415927f * 2f / (float)this.numberOfObjects;
			Vector3 vector = base.gameObject.transform.position + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * this.radius;
			if (Physics.Raycast(vector + new Vector3(0f, 10f, 0f), Vector3.up * -1f, out this.hit, 20f, 8))
			{
				vector = this.hit.point;
				GameObject gameObject = this.CreateSphere(vector, 0.5f);
				gameObject.transform.rotation = Quaternion.LookRotation(vector - base.gameObject.transform.position);
				gameObject.transform.Rotate(new Vector3(0f, 0f, 90f));
			}
		}
	}

	// Token: 0x0400173D RID: 5949
	public int numberOfObjects = 30;

	// Token: 0x0400173E RID: 5950
	public float radius = 6f;

	// Token: 0x0400173F RID: 5951
	private RaycastHit hit;
}
