Advertisement
shadowplaycoding

P006_SpaceObjects

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