Barotrauma Client Doc
Barotrauma.LevelObject Class Reference
Inheritance diagram for Barotrauma.LevelObject:
Barotrauma.ISpatialEntity Barotrauma.IDamageable Barotrauma.ISerializableEntity

Public Member Functions

 LevelObject (LevelObjectPrefab prefab, Vector3 position, float scale, float rotation=0.0f)
 
AttackResult AddDamage (Character attacker, Vector2 worldPosition, Attack attack, Vector2 impulseDirection, float deltaTime, bool playSound=true)
 
void AddDamage (float damage, float deltaTime, Entity attacker, bool isNetworkEvent=false)
 
Vector2 LocalToWorld (Vector2 localPosition, float swingState=0.0f)
 
void Remove ()
 
override string ToString ()
 
void ServerWrite (IWriteMessage msg, Client c)
 
void Update (float deltaTime)
 
void ClientRead (IReadMessage msg)
 

Public Attributes

readonly LevelObjectPrefab Prefab
 
Vector3 Position
 
float NetworkUpdateTimer
 
float Scale
 
float Rotation
 
LevelObjectPrefab ActivePrefab
 
Level.Cave ParentCave
 
float SwingTimer
 
float ScaleOscillateTimer
 
float CurrentSwingAmount
 
Vector2 CurrentScaleOscillation
 
float CurrentRotation
 

Protected Attributes

bool tookDamage
 

Properties

PhysicsBody PhysicsBody [get]
 
List< LevelTriggerTriggers [get]
 
bool NeedsNetworkSyncing [get, set]
 
bool NeedsUpdate [get]
 
float Health [get]
 
Sprite??? Sprite [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties = new Dictionary<Identifier, SerializableProperty>() [get]
 
Vector2 CurrentScale = Vector2.One [get]
 
LightSource[] LightSources [get]
 
LevelTrigger[] LightSourceTriggers [get]
 
ParticleEmitter[] ParticleEmitters [get]
 
LevelTrigger[] ParticleEmitterTriggers [get]
 
RoundSound[] Sounds [get]
 
SoundChannel[] SoundChannels [get]
 
LevelTrigger[] SoundTriggers [get]
 
Vector2[,] CurrentSpriteDeformation [get]
 
bool VisibleOnSonar [get]
 
float SonarRadius [get]
 
bool CanBeVisible [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
- Properties inherited from Barotrauma.IDamageable
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
float Health [get]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ LevelObject()

Barotrauma.LevelObject.LevelObject ( LevelObjectPrefab  prefab,
Vector3  position,
float  scale,
float  rotation = 0.0f 
)

Member Function Documentation

◆ AddDamage() [1/2]

AttackResult Barotrauma.LevelObject.AddDamage ( Character  attacker,
Vector2  worldPosition,
Attack  attack,
Vector2  impulseDirection,
float  deltaTime,
bool  playSound = true 
)

◆ AddDamage() [2/2]

void Barotrauma.LevelObject.AddDamage ( float  damage,
float  deltaTime,
Entity  attacker,
bool  isNetworkEvent = false 
)

◆ ClientRead()

void Barotrauma.LevelObject.ClientRead ( IReadMessage  msg)

◆ LocalToWorld()

Vector2 Barotrauma.LevelObject.LocalToWorld ( Vector2  localPosition,
float  swingState = 0.0f 
)

◆ Remove()

void Barotrauma.LevelObject.Remove ( )

◆ ServerWrite()

void Barotrauma.LevelObject.ServerWrite ( IWriteMessage  msg,
Client  c 
)

◆ ToString()

override string Barotrauma.LevelObject.ToString ( )

◆ Update()

void Barotrauma.LevelObject.Update ( float  deltaTime)

Member Data Documentation

◆ ActivePrefab

LevelObjectPrefab Barotrauma.LevelObject.ActivePrefab

◆ CurrentRotation

float Barotrauma.LevelObject.CurrentRotation

◆ CurrentScaleOscillation

Vector2 Barotrauma.LevelObject.CurrentScaleOscillation

◆ CurrentSwingAmount

float Barotrauma.LevelObject.CurrentSwingAmount

◆ NetworkUpdateTimer

float Barotrauma.LevelObject.NetworkUpdateTimer

◆ ParentCave

Level.Cave Barotrauma.LevelObject.ParentCave

◆ Position

Vector3 Barotrauma.LevelObject.Position

◆ Prefab

readonly LevelObjectPrefab Barotrauma.LevelObject.Prefab

◆ Rotation

float Barotrauma.LevelObject.Rotation

◆ Scale

float Barotrauma.LevelObject.Scale

◆ ScaleOscillateTimer

float Barotrauma.LevelObject.ScaleOscillateTimer

◆ SwingTimer

float Barotrauma.LevelObject.SwingTimer

◆ tookDamage

bool Barotrauma.LevelObject.tookDamage
protected

Property Documentation

◆ CanBeVisible

bool Barotrauma.LevelObject.CanBeVisible
get

◆ CurrentScale

Vector2 Barotrauma.LevelObject.CurrentScale = Vector2.One
get

◆ CurrentSpriteDeformation

Vector2 [,] Barotrauma.LevelObject.CurrentSpriteDeformation
get

◆ Health

float Barotrauma.LevelObject.Health
get

◆ LightSources

LightSource [] Barotrauma.LevelObject.LightSources
get

◆ LightSourceTriggers

LevelTrigger [] Barotrauma.LevelObject.LightSourceTriggers
get

◆ Name

string Barotrauma.LevelObject.Name
get

◆ NeedsNetworkSyncing

bool Barotrauma.LevelObject.NeedsNetworkSyncing
getset

◆ NeedsUpdate

bool Barotrauma.LevelObject.NeedsUpdate
get

◆ ParticleEmitters

ParticleEmitter [] Barotrauma.LevelObject.ParticleEmitters
get

◆ ParticleEmitterTriggers

LevelTrigger [] Barotrauma.LevelObject.ParticleEmitterTriggers
get

◆ PhysicsBody

PhysicsBody Barotrauma.LevelObject.PhysicsBody
get

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.LevelObject.SerializableProperties = new Dictionary<Identifier, SerializableProperty>()
get

◆ SimPosition

Vector2 Barotrauma.LevelObject.SimPosition
get

◆ SonarRadius

float Barotrauma.LevelObject.SonarRadius
get

◆ SoundChannels

SoundChannel [] Barotrauma.LevelObject.SoundChannels
get

◆ Sounds

RoundSound [] Barotrauma.LevelObject.Sounds
get

◆ SoundTriggers

LevelTrigger [] Barotrauma.LevelObject.SoundTriggers
get

◆ Sprite

Sprite??? Barotrauma.LevelObject.Sprite
get

◆ Submarine

Submarine Barotrauma.LevelObject.Submarine
get

◆ Triggers

List<LevelTrigger> Barotrauma.LevelObject.Triggers
get

◆ VisibleOnSonar

bool Barotrauma.LevelObject.VisibleOnSonar
get

◆ WorldPosition

Vector2 Barotrauma.LevelObject.WorldPosition
get