protected void RegisterPlayerDataChangeCallback <TChangeType>(PlayerObjectField field, [NotNull] Action <NetworkEntityGuid, EntityDataChangedArgs <TChangeType> > callback) where TChangeType : struct { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } EntityDataCallbackRegister.RegisterCallback(PlayerDetails.LocalPlayerGuid, (int)field, callback); }
public static TValueType GetFieldValue <TValueType>(this IReadonlyEntityDataFieldContainer container, PlayerObjectField index) where TValueType : struct { if (container == null) { throw new ArgumentNullException(nameof(container)); } return(container.GetFieldValue <TValueType>((int)index)); }