Class: Cukunity::Unity::Scene

Inherits:
JSONContainer show all
Defined in:
lib/cukunity/unity/scene.rb

Instance Attribute Summary collapse

Attributes inherited from JSONContainer

#json

Instance Method Summary collapse

Methods inherited from JSONContainer

#has_key?, #keys, #method_missing, #to_s, #value_of

Methods included from Cukunity::Utils

#check_timeout, #merge_options, #restrict_options, #to_options, #wait_connectivity

Constructor Details

#initialize(client, *args) ⇒ Scene

Returns a new instance of Scene.



6
7
8
9
# File 'lib/cukunity/unity/scene.rb', line 6

def initialize(client, *args)
  @client = client
  super(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cukunity::Unity::JSONContainer

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/cukunity/unity/scene.rb', line 4

def client
  @client
end

Instance Method Details

#gameobjectsObject



11
12
13
14
15
# File 'lib/cukunity/unity/scene.rb', line 11

def gameobjects
  @gameobjects ||= (value_of('gameObjects') || []).map do |json|
    Unity::GameObject.new(json, self)
  end
end