본문 바로가기

Game/Unity

[Unity3D]Circle

원 공격 하기


public float angle = 1f;

public float count = 10;
private int cal = 0;


void Skill ()

{

    StartCoroutine (Fire ());

}


private IEnumerator Fire ()
{
    Vector3 pointPos;

    for (int j = 0j < countj++) {
        float pointNum = (j * 1.0f) / count;
                
        float angle = pointNum * Mathf.PI * 2;
                
        float x = Mathf.Sin (angle) * (1 + cal);
        float y = Mathf.Cos (angle) * (1 + cal);
                
        pointPos = new Vector3 (x0.5fy) + transform.position;
                
        ObjectPoolUtil.CreateClone (attackPrefabpointPosQuaternion.identity);
    }
}