shadowplaycoding

P002_SpaceObjects

Sep 13th, 2019 (edited)
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public static class SpaceObjects
  6. {
  7.     public static GameObject CreateSphereObject(string name, Vector3 position, Transform parent = null){
  8.         GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  9.         sphere.name = name;
  10.         sphere.transform.position = position;
  11.         sphere.transform.parent = parent;
  12.         return sphere;
  13.     }
  14. }
  15.  
  16. /*
  17. Copyright Shadowplay Coding 2021 - see www.shadowplaycoding.com for licensing details
  18. Removing this comment forfits any rights given to the user under licensing.
  19. */
Add Comment
Please, Sign In to add comment