SHARE
TWEET

P018_FleetManager

shadowplaycoding Apr 14th, 2017 (edited) 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top