Author Topic: SGSK - ngui and NetworkInstantiate  (Read 2890 times)

emachala

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
SGSK - ngui and NetworkInstantiate
« on: September 28, 2014, 01:24:38 PM »
Im looking for the best way to have a drop down using Ngui, new to me, to select 1 of 4 ships and then when you join or host, you connect in your chosen ship.

sure i need to add all 4 ships to the tn manager.

But, How do i get the ngui select drop down to tell NetworkInstantiate which prefab to use on player join?

-e


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: SGSK - ngui and NetworkInstantiate
« Reply #1 on: September 29, 2014, 07:28:47 AM »
  1. TNManager.playerDataNode.SetChild("Ship", yourShipNumber);
  2. TNManager.Sync();
Then on all clients you can retrieve this value:
  1. player.dataNode.GetChild<int>("Ship");

emachala

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: SGSK - ngui and NetworkInstantiate
« Reply #2 on: September 30, 2014, 02:58:39 PM »
perfect thanks