Пример #1
0
        public void Setup()
        {
            serverTester   = CreateBehaviour <SyncVarHookTester>();
            serverIdentity = serverTester.Identity;
            clientTester   = CreateBehaviour <SyncVarHookTester>();
            clientIdentity = clientTester.Identity;

            serverTester.value1 = 1;
            serverTester.value2 = 2;

            SyncValuesWithClient();
        }
Пример #2
0
        public void Setup()
        {
            // create server and client objects and sync inital values

            var gameObject1 = new GameObject();

            netIdServer  = gameObject1.AddComponent <NetworkIdentity>();
            serverTester = gameObject1.AddComponent <SyncVarHookTester>();

            var gameObject2 = new GameObject();

            netIdClient  = gameObject2.AddComponent <NetworkIdentity>();
            clientTester = gameObject2.AddComponent <SyncVarHookTester>();

            serverTester.value1 = 1;
            serverTester.value2 = 2;

            SyncValuesWithClient();
        }