Class: U3d::UnityProject

Inherits:
Object
  • Object
show all
Defined in:
lib/u3d/installer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ UnityProject

Returns a new instance of UnityProject.



431
432
433
# File 'lib/u3d/installer.rb', line 431

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



429
430
431
# File 'lib/u3d/installer.rb', line 429

def path
  @path
end

Instance Method Details

#editor_versionObject



439
440
441
442
443
# File 'lib/u3d/installer.rb', line 439

def editor_version
  require 'yaml'
  yaml = YAML.load(File.read("#{@path}/ProjectSettings/ProjectVersion.txt"))
  yaml['m_EditorVersion']
end

#exist?Boolean

Returns:

  • (Boolean)


435
436
437
# File 'lib/u3d/installer.rb', line 435

def exist?
  Dir.exist?("#{@path}/Assets") && Dir.exist?("#{@path}/ProjectSettings")
end