rendered paste bodyusing UnityEngine;
using System.Collections;
using System;
public class bulletmanager : MonoBehaviour {
public GameObject projectile;
private float radius=10;
private double pointx,pointy;
private float degrees;
private double angle,angle1,angle2;
private Vector2 position;
// Use this for initialization
void Start () {
angle=1;
angle1=Math.Cos(DegreeToRadian(angle));
angle2=Math.Cos(DegreeToRadian(angle));
pointx=radius*angle1;
pointy=radius*angle2;
position=new Vector2((float)pointx,(float)pointy);
drawcircle();
}
// Update is called once per frame
void Update () {
}
private double DegreeToRadian(double a)
{
double answer;
answer = Math.PI * (a/180.0);
return answer;
}
void drawcircle()
{
for(int i=0;i<360;i++)
{
angle1=Math.Cos(DegreeToRadian(angle+i));
angle2=Math.Cos(DegreeToRadian(angle+i));
pointx=radius*angle1;
pointy=radius*angle2;
position=new Vector2((float)pointx,(float)pointy);
Instantiate(projectile,position,Quaternion.identity);
Debug.Log(pointx);
Debug.Log(pointy);
}
}
}