void Start()
 {
     smoothDampCurrentVelocity = Vector3.zero;
     shipSelectionController   = GameObject.Find("ShipSelection/ShipSelectionController").GetComponent <ShipSelectionController>();
     initialOffset             = GameObject.Find("ShipSelection/NavPoint").transform.position -
                                 shipSelectionController.GetCurrentShipPlatform().transform.position;
 }
Ejemplo n.º 2
0
    public void AddSelection(bool selected)
    {
        ShipSelectionController shipSelectionController = GameObject.Find(shipName + "Container").GetComponent <ShipSelectionController>();

        shipSelectionController.SelectShip(selected);
        if (selected)
        {
            ShipSelectionController.AddChosenShip(gameObject.name.Substring(0, gameObject.name.Length - 7));
        }
        else
        {
            ShipSelectionController.RemoveChosenShip(gameObject.name.Substring(0, gameObject.name.Length - 7));
        }
        CloseShipStatsMenu();
    }
Ejemplo n.º 3
0
 public SelectionHandler(Context context)
 {
     _context                = context;
     playersController       = new PlayersController(_context);
     baController            = new BAController(_context);
     cellsController         = new CellsController(_context);
     shipTypeController      = new ShipTypeController(_context);
     shipsController         = new ShipsController(_context);
     duelsController         = new DuelsController(_context);
     shipSelectionController = new ShipSelectionController(_context);
     armorSelection          = new ArmorSelectionController(_context);
     strategyController      = new StrategyController(_context);
     placeShipSelection      = new PlaceShipSelection(shipSelectionController, _context);
     placeArmorSelection     = new PlaceArmorSelection(armorSelection, _context);
     proxyPlayerTurn         = new ProxyPlayerTurn(_context);
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        playerShips   = ShipSelectionController.GetChosenShips();
        lastPosition  = GameObject.Find("LeftBorder").transform.position.x + spacing;
        rightEdge     = GameObject.Find("RightBorder").transform.position.x - spacing;
        selectedShips = new ObservableCollection <string>();
        selectedShips.CollectionChanged += HandleChange;

        foreach (string ship in playerShips)
        {
            if (ship.Equals("Frigate"))
            {
                for (int i = 0; i < frigateCount; i++)
                {
                    InstantiateShips("Frigate", new Vector3(0.30f, 0.30f, 0.30f), new Vector3(lastPosition, -20f, -7f));
                }
                SetParentShip("Frigate");
            }
            else if (ship.Equals("Corvette"))
            {
                for (int i = 0; i < corvetteCount; i++)
                {
                    InstantiateShips("Corvette", new Vector3(0.30f, 0.30f, 0.30f), new Vector3(lastPosition, -20f, -7f));
                }
                SetParentShip("Corvette");
            }
            else if (ship.Equals("Destroyer"))
            {
                for (int i = 0; i < destroyerCount; i++)
                {
                    InstantiateShips("Destroyer", new Vector3(0.30f, 0.30f, 0.30f), new Vector3(lastPosition, -20f, -7f));
                }
                SetParentShip("Destroyer");
            }
            else if (ship.Equals("Battleship"))
            {
                InstantiateShips("Battleship", new Vector3(1f, 1f, 1f), new Vector3(lastPosition += 10, -20f, -7f));
                lastPosition += 10;
                SetParentShip("Battleship");
            }
            else if (ship.Equals("Hubship"))
            {
                InstantiateShips("Hubship", new Vector3(0.30f, 0.30f, 0.30f), new Vector3(lastPosition, -20f, -7f));
                SetParentShip("Hubship");
            }
        }
    }
Ejemplo n.º 5
0
 void Start()
 {
     shipSelectionController = GameObject.Find("ShipSelectionController").GetComponent <ShipSelectionController>();
 }
Ejemplo n.º 6
0
 new void Awake()
 {
     base.Awake();
     ssc    = GameObject.Find("ShipSelectionController").GetComponent <ShipSelectionController>();
     canvas = transform.FindChild("Canvas").gameObject;
 }