Beispiel #1
0
    public static DoorUpdateMessage Send(GameObject recipient, GameObject door, DoorUpdateType type)
    {
        var msg = new DoorUpdateMessage {
            Door = door.NetId(),
            Type = type,
        };

        msg.SendTo(recipient);
        return(msg);
    }
    /// <summary>
    /// Send update to one player
    /// </summary>
    /// <param name="recipient">gameobject of the player recieving it</param>
    /// <param name="door">door being updated</param>
    /// <param name="type">animation to play</param>
    /// <param name="skipAnimation">if true, all sound and animations will be skipped, leaving it in its end position.
    ///     Currently only used for when players are joining and there are open doors.</param>
    /// <returns></returns>
    public static DoorUpdateMessage Send(GameObject recipient, GameObject door, DoorUpdateType type, bool skipAnimation = false)
    {
        var msg = new DoorUpdateMessage {
            Door          = door.NetId(),
            Type          = type,
            SkipAnimation = skipAnimation
        };

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