generating circles

This commit is contained in:
nexovec 2022-01-29 16:27:55 +01:00
parent 0cb415d674
commit 4b68e368fd
3 changed files with 601 additions and 451 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CirclePlatformGenerator : MonoBehaviour
{
public Object objectToCopy;
// Start is called before the first frame update
void Start()
{
int pieceCount = 10;
float angle = 360f / (float)pieceCount;
// var axis = transform.RotateAround(axis, angle * Time.deltaTime * 5f);
for (int i = 0; i < pieceCount; i++)
{
Quaternion rotation = Quaternion.AngleAxis(i * angle, Vector3.forward);
Vector3 direction = rotation * Vector3.forward;
Vector3 position = transform.position + (direction * 20);
Instantiate(this.objectToCopy, Vector3.zero, rotation);
}
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0418fbcc3e28fec4696b40ecbbf51c7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: