//	/// <summary>
//	/// Applies the camera dampening when the camera reaches the closet.
//	/// This makes the camera snap the to closet before making the camera "drag" as the closet moves.
//	/// Snapping the camera to the closet is needed for when a player inside the closet rejoins the game, otherwise the
//	/// camera will move/"drag" from coordinate 0,0 across the station to the closet's position.
//	/// </summary>
//	IEnumerator WaitForCameraToReachCloset()
//	{
//		yield return new WaitUntil(() =>
//			Camera2DFollow.followControl.transform == Camera2DFollow.followControl.target);
//		Camera2DFollow.followControl.damping = 0.2f;
//	}

    public static ClosetHandlerMessage Send(GameObject recipient, GameObject closet)
    {
        ClosetHandlerMessage msg = new ClosetHandlerMessage
        {
            Closet = closet.NetId()
        };

        msg.SendTo(recipient);
        return(msg);
    }
Esempio n. 2
0
    public static ClosetHandlerMessage Send(GameObject recipient, GameObject closet)
    {
        ClosetHandlerMessage msg = new ClosetHandlerMessage
        {
            Recipient = recipient.GetComponent <NetworkIdentity>().netId,
            Closet    = closet
        };

        msg.SendTo(recipient);
        return(msg);
    }