31 [Obsolete(
"该字段已弃用,掉落物被玩家的拾取逻辑被转移到ComponentPickableGathererPlayer中")]
63 if (pickable ==
null) {
73 loader.OnPickableAdded(
this, ref pickable,
null);
85 AddPickable(value, count, position, velocity, stuckMatrix,
null);
97 pickable.InitializeData(
104 pickable.Initialize(value, count, position, velocity, stuckMatrix, owner);
108 catch (Exception e) {
109 Log.
Error($
"Pickable create error: {e}");
117 T pickable =
CreatePickable<T>(value, count, position, velocity, stuckMatrix, owner);
119 return pickable2 as T;
121 catch (Exception e) {
122 Log.
Error($
"Pickable add error: {e}");
135 pickable.
Draw(camera, drawOrder, totalElapsedGameTime, matrix);
137 catch (Exception e) {
139 Log.
Error($
"Pickable draw error: {e}");
140 pickable.LogDrawError =
false;
159 catch (Exception e) {
160 Log.
Error($
"Pickable update error: {e}");
161 pickable.ToRemove =
true;
187 string className = item.GetValue(
"Class", typeof(
Pickable).FullName);
189#pragma warning disable IL2072
190 if (Activator.CreateInstance(type) is
Pickable pickable) {
191#pragma warning restore IL2072
193 pickable.InitializeData(
204 loader.OnPickableAdded(
this, ref pickable, item);
213 catch (Exception ex) {
222 valuesDictionary.SetValue(
"Pickables", valuesDictionary2);
227 pickable.
Save(valuesDictionary3);
231 loader.SavePickable(
this, pickable, ref valuesDictionary3);
235 valuesDictionary2.SetValue(num.ToString(), valuesDictionary3);
static void Error(object message)
static float Remainder(float x, float y)
static Type FindType(string typeName, bool skipSystemAssemblies, bool throwIfNotFound)
Matrix ViewProjectionMatrix
virtual void Update(float dt)
virtual void Draw(Camera camera, int drawOrder, double totalElapsedGameTime, Matrix rotationMatrix)
virtual void Save(ValuesDictionary valuesDictionary)
virtual Pickable AddPickable(int value, int count, Vector3 position, Vector3? velocity, Matrix? stuckMatrix)
PrimitivesRenderer3D m_primitivesRenderer
virtual void Update(float dt)
static int[] m_drawOrders
virtual Pickable AddPickable(Pickable pickable)
virtual Action< Pickable > PickableRemoved
ReadOnlyList< Pickable > Pickables
List< ComponentPlayer > m_tmpPlayers
SubsystemPlayers m_subsystemPlayers
SubsystemTerrain m_subsystemTerrain
SubsystemGameInfo m_subsystemGameInfo
float DefaultCalcVisibilityRange()
virtual Action< Pickable > PickableAdded
SubsystemParticles m_subsystemParticles
virtual void Draw(Camera camera, int drawOrder)
SubsystemBlockBehaviors m_subsystemBlockBehaviors
SubsystemFireBlockBehavior m_subsystemFireBlockBehavior
SubsystemFluidBlockBehavior m_subsystemFluidBlockBehavior
virtual Pickable AddPickable(int value, int count, Vector3 position, Vector3? velocity, Matrix? stuckMatrix, Entity owner)
virtual Pickable CreatePickable(int value, int count, Vector3 position, Vector3? velocity, Matrix? stuckMatrix, Entity owner)
virtual T CreatePickable< T >(int value, int count, Vector3 position, Vector3? velocity, Matrix? stuckMatrix, Entity owner)
virtual T AddPickable< T >(int value, int count, Vector3 position, Vector3? velocity, Matrix? stuckMatrix, Entity owner)
override void Save(ValuesDictionary valuesDictionary)
List< Pickable > m_pickables
SubsystemExplosions m_subsystemExplosions
SubsystemTime m_subsystemTime
SubsystemAudio m_subsystemAudio
override void Load(ValuesDictionary valuesDictionary)
SubsystemSky m_subsystemSky
DrawBlockEnvironmentData m_drawBlockEnvironmentData
List< Pickable > m_pickablesToRemove
ValuesDictionary ValuesDictionary
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
static Matrix CreateRotationY(float radians)