Class: Engine::Components::DirectionLight

Inherits:
Engine::Component show all
Defined in:
lib/engine/components/direction_light.rb

Instance Attribute Summary collapse

Attributes inherited from Engine::Component

#game_object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Engine::Component

#_erase!, #destroy, #destroyed?, destroyed_components, erase_destroyed_components, method_added, #renderer?, #set_game_object, #ui_renderer?, #update

Constructor Details

#initialize(colour: [1.0, 1.0, 1.0]) ⇒ DirectionLight

Returns a new instance of DirectionLight.



7
8
9
# File 'lib/engine/components/direction_light.rb', line 7

def initialize(colour: [1.0, 1.0, 1.0])
  @colour = colour
end

Instance Attribute Details

#colourObject

Returns the value of attribute colour.



5
6
7
# File 'lib/engine/components/direction_light.rb', line 5

def colour
  @colour
end

Class Method Details

.direction_lightsObject



19
20
21
# File 'lib/engine/components/direction_light.rb', line 19

def self.direction_lights
  @direction_lights ||= []
end

Instance Method Details

#destroy!Object



15
16
17
# File 'lib/engine/components/direction_light.rb', line 15

def destroy!
  DirectionLight.direction_lights.delete(self)
end

#startObject



11
12
13
# File 'lib/engine/components/direction_light.rb', line 11

def start
  DirectionLight.direction_lights << self
end