agones.dev/agones@v1.53.0/examples/unity-simple/Assets/Scripts/UdpEchoController.cs (about)

     1  // Copyright 2019 Google LLC
     2  // All Rights Reserved.
     3  //
     4  // Licensed under the Apache License, Version 2.0 (the "License");
     5  // you may not use this file except in compliance with the License.
     6  // You may obtain a copy of the License at
     7  //
     8  //     http://www.apache.org/licenses/LICENSE-2.0
     9  //
    10  // Unless required by applicable law or agreed to in writing, software
    11  // distributed under the License is distributed on an "AS IS" BASIS,
    12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  
    16  using UnityEngine;
    17  
    18  namespace AgonesExample
    19  {
    20      public class UdpEchoController : MonoBehaviour
    21      {
    22          [SerializeField]
    23          private GameObject server;
    24          [SerializeField]
    25          private GameObject client;
    26  
    27          void Start()
    28          {
    29              server.SetActive(false);
    30              client.SetActive(false);
    31  
    32  #if (UNITY_EDITOR || UNITY_SERVER)
    33              server.SetActive(true);
    34  #endif
    35  #if !UNITY_SERVER
    36              client.SetActive(true);
    37  #endif
    38          }
    39      }
    40  }