Class DroppedItem
Base class for any items dropped on the floor that the player can collect
Inheritance
Object
Component
Behaviour
MonoBehaviour
DroppedItem
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
public abstract class DroppedItem : MonoBehaviour
Fields
| Edit this page View SourceFlingAngleMinMax
Declaration
[SerializeField]
[Tooltip("The angle range the object will be flung at")]
public Vector2 FlingAngleMinMax
Field Value
Type | Description |
---|---|
Vector2 |
FlingSpeedMinMax
Declaration
[SerializeField]
[Tooltip("The speed range the object will be flung at")]
public Vector2 FlingSpeedMinMax
Field Value
Type | Description |
---|---|
Vector2 |
Properties
| Edit this page View SourceFlingOnStart
Declaration
public bool FlingOnStart { get; set; }
Property Value
Type | Description |
---|---|
bool |
InspectionRegion
Declaration
public InspectRegion InspectionRegion { get; }
Property Value
Type | Description |
---|---|
InspectRegion |
ItemActive
Declaration
public bool ItemActive { get; set; }
Property Value
Type | Description |
---|---|
bool |
RB
Declaration
public Rigidbody2D RB { get; }
Property Value
Type | Description |
---|---|
Rigidbody2D |
SettingsField
Declaration
public string SettingsField { get; set; }
Property Value
Type | Description |
---|---|
string |
SettingsStorage
Declaration
public SaveSpecificSettings SettingsStorage { get; set; }
Property Value
Type | Description |
---|---|
SaveSpecificSettings |
Methods
| Edit this page View SourceAwake()
Declaration
protected virtual void Awake()
CanSpawn()
Returns whether or not this item can spawn.
Declaration
protected virtual bool CanSpawn()
Returns
Type | Description |
---|---|
bool | Returns true if the item can spawn. If false, then the item will get destroyed |
GiveItem()
Gives the item to the player. This is automatically called when the player goes near the item and inspects it
Declaration
public void GiveItem()
OnActive()
Called when the item is spawned
Declaration
protected virtual void OnActive()
OnGiveItem()
Called when the player picks up an item. Implement your custom item behavior in here
Declaration
protected abstract void OnGiveItem()