Advertisement
shadowplaycoding

P018_FleetManager

Apr 14th, 2017
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5.  
  6. public class FleetManager : MonoBehaviour {
  7.  
  8.     public List<Fleet> fleetList;
  9.  
  10.     int shipCount;
  11.  
  12.     // Use this for initialization
  13.     void Start () {
  14.         fleetList = new List<Fleet>(); 
  15.     }
  16.  
  17.     public void BuildShip()
  18.     {
  19.         Ship ship = new Ship("Ship " + shipCount, 10, 10);
  20.         Fleet fleet = new Fleet("Fleet " + (fleetList.Count + 1), ship);
  21.  
  22.         fleetList.Add(fleet);
  23.  
  24.         GameObject shipObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
  25.         shipObject.transform.position = PositionMath.RandomPosition(-50, 50);
  26.     }
  27.  
  28.     /*
  29.     Copyright Shadowplay Coding 2017 - see www.shadowplaycoding.com for licensing details
  30.     Removing this comment forfits any rights given to the user under licensing.
  31.     */
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement