예제 #1
0
 private bool onRemotePlayerJoinedRoom(NetworkControllerEvents.RemotePlayerJoinedRoomEvent evt)
 {
     if (Service.Get <CPDataEntityCollection>().TryGetComponent <DisplayNameData>(evt.Handle, out var component) && component.DisplayName.StartsWith(BotName))
     {
         Transform  botContainer = RemotePlayerBotUtil.GetBotContainer();
         GameObject gameObject   = new GameObject(component.DisplayName);
         gameObject.transform.SetParent(botContainer);
         RemotePlayerBot remotePlayerBot = gameObject.AddComponent <RemotePlayerBot>();
         remotePlayerBot.Handle = evt.Handle;
         remotePlayerBot.RandomizeClothing();
         remotePlayerBot.RandomizeColor();
         remotePlayerBot.RandomizePosition(base.transform.position, SpawnRadius);
         if (AutoRemove)
         {
             remotePlayerBot.Remove(UnityEngine.Random.Range(0.2f, 10f));
         }
     }
     return(false);
 }
 private bool onRemotePlayerJoinedRoom(NetworkControllerEvents.RemotePlayerJoinedRoomEvent evt)
 {
     createRemotePlayer(evt.Handle);
     return(false);
 }