Example #1
0
        void Start()
        {
            this.TargetPosition = null;

            this.shipCanvas_Player_1 = this.GetComponentsInChildren <ShipCanvas>()[0];
            this.shipCanvas_Player_2 = this.GetComponentsInChildren <ShipCanvas>()[1];

            //Asocio el barco a la celda del tablero correspondiente
            Cell actualCell = GridManager.Instance.GetCell(this.ActualPosition);

            actualCell.SetShipCell(this);

            //Posicion el barco en la celda a la altura indicada
            this.transform.position = new Vector3(actualCell.WorldPosition.x, this.ShipHeight, actualCell.WorldPosition.z);

            //Asocio el mazo al barco
            this.Deck = new ShipDeck(TextsManager.Instance.ShipDecks[this.ShipID]);
            this.Deck.ShuffleDeck();

            //Actualizo la vida del barco
            this.UpdateLifeBoat();
        }
Example #2
0
 void OnEnable()
 {
     instance = this;
     PlayerInput.OnInteract += Interact;
 }