You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
810 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Networking;
  5. using Networking.Server;
  6. using Networking;
  7. public class NetworkedClient : MonoBehaviour
  8. {
  9. public ServerObject server;
  10. //public Character character;
  11. public BlockInput input;
  12. // Start is called before the first frame update
  13. void Start()
  14. {
  15. Debug.Log("Registering: " + LogicProtocols.SendLogicList);
  16. server.RegisterHandler(LogicProtocols.SendLogicList, RecieveLogicList);
  17. }
  18. public void RecieveLogicList(NetworkMessage msg)
  19. {
  20. LogicProtocols.LogicMsg logicMsg;
  21. if (!msg.TryRead(out logicMsg))
  22. return;
  23. input.blockReader.LogicChain = new List<LogicBlock>(logicMsg.elements);
  24. input.ReadAll();
  25. }
  26. }