コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }