using System.Collections.Generic;
using UnityEngine;
using Mirror;
/*
Documentation: https://mirror-networking.gitbook.io/docs/guides/networkbehaviour
API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkBehaviour.html
*/
// NOTE: Do not put objects in DontDestroyOnLoad (DDOL) in Awake. You can do that in Start instead.
public class #SCRIPTNAME# : NetworkBehaviour
{
#region Unity Callbacks
///
/// Add your validation code here after the base.OnValidate(); call.
///
protected override void OnValidate()
{
base.OnValidate();
}
#endregion
#region Start & Stop Callbacks
///
/// This is invoked for NetworkBehaviour objects when they become active on the server.
/// This could be triggered by NetworkServer.Listen() for objects in the scene, or by NetworkServer.Spawn() for objects that are dynamically created.
/// This will be called for objects on a "host" as well as for object on a dedicated server.
///
public override void OnStartServer() { }
///
/// Invoked on the server when the object is unspawned
/// Useful for saving object data in persistent storage
///
public override void OnStopServer() { }
///
/// Called on every NetworkBehaviour when it is activated on a client.
/// Objects on the host have this function called, as there is a local client on the host. The values of SyncVars on object are guaranteed to be initialized correctly with the latest state from the server when this function is called on the client.
///
public override void OnStartClient() { }
///
/// This is invoked on clients when the server has caused this object to be destroyed.
/// This can be used as a hook to invoke effects or do client specific cleanup.
///
public override void OnStopClient() { }
///
/// Called when the local player object has been set up.
/// This happens after OnStartClient(), as it is triggered by an ownership message from the server. This is an appropriate place to activate components or functionality that should only be active for the local player, such as cameras and input.
///
public override void OnStartLocalPlayer() { }
///
/// Called when the local player object is being stopped.
/// This happens before OnStopClient(), as it may be triggered by an ownership message from the server, or because the player object is being destroyed. This is an appropriate place to deactivate components or functionality that should only be active for the local player, such as cameras and input.
///
public override void OnStopLocalPlayer() {}
///
/// This is invoked on behaviours that have authority, based on context and NetworkIdentity.hasAuthority.
/// This is called after OnStartServer and before OnStartClient.
/// When AssignClientAuthority is called on the server, this will be called on the client that owns the object. When an object is spawned with NetworkServer.Spawn with a NetworkConnectionToClient parameter included, this will be called on the client that owns the object.
///
public override void OnStartAuthority() { }
///
/// This is invoked on behaviours when authority is removed.
/// When NetworkIdentity.RemoveClientAuthority is called on the server, this will be called on the client that owns the object.
///
public override void OnStopAuthority() { }
#endregion
}