2020-01-19 21:44:54 +00:00
|
|
|
using UnityEngine;
|
|
|
|
using Mirror;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Visibility Guide: https://mirror-networking.com/docs/Guides/Visibility.html
|
|
|
|
API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkBehaviour.html
|
|
|
|
*/
|
|
|
|
|
2020-04-14 00:05:00 +00:00
|
|
|
public class #SCRIPTNAME# : NetworkVisibility
|
2020-01-19 21:44:54 +00:00
|
|
|
{
|
2020-04-14 00:05:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Callback used by the visibility system to determine if an observer (player) can see this object.
|
|
|
|
/// <para>If this function returns true, the network connection will be added as an observer.</para>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="conn">Network connection of a player.</param>
|
|
|
|
/// <returns>True if the player can see this object.</returns>
|
|
|
|
public override bool OnCheckObserver(NetworkConnection conn)
|
|
|
|
{
|
2020-05-05 04:37:21 +00:00
|
|
|
return true;
|
2020-04-14 00:05:00 +00:00
|
|
|
}
|
|
|
|
|
2020-01-19 21:44:54 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Callback used by the visibility system to (re)construct the set of observers that can see this object.
|
|
|
|
/// <para>Implementations of this callback should add network connections of players that can see this object to the observers set.</para>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="observers">The new set of observers for this object.</param>
|
|
|
|
/// <param name="initialize">True if the set of observers is being built for the first time.</param>
|
2020-04-12 11:54:11 +00:00
|
|
|
public override void OnRebuildObservers(HashSet<NetworkConnection> observers, bool initialize) { }
|
2020-01-19 21:44:54 +00:00
|
|
|
}
|