echinoidea 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/echinoidea CHANGED
@@ -35,6 +35,7 @@ end
35
35
  config = YAML.load_file([current_dir, "echinoidea.yml"].join("/"))
36
36
 
37
37
  builder = Echinoidea::Builder.new(current_dir)
38
+ builder.bundle_identifier = config['bundle_identifier'] if config['bundle_identifier']
38
39
  builder.scenes = config['scenes']
39
40
  builder.output_directory = OPTS[:o]
40
41
 
@@ -2,7 +2,7 @@ require 'echinoidea/version'
2
2
 
3
3
  class Echinoidea::Builder
4
4
  attr_reader :class_name, :file_path
5
- attr_accessor :scenes, :output_directory
5
+ attr_accessor :bundle_identifier, :output_directory, :scenes
6
6
 
7
7
  def self.unique_builder_class_name
8
8
  "ECBuilder#{Time.now.strftime('%y%m%d%H%M%S')}"
@@ -21,6 +21,12 @@ class Echinoidea::Builder
21
21
  # Thanks to: http://ameblo.jp/principia-ca/entry-11010391965.html
22
22
  File.open(self.file_path,'w'){|f|
23
23
  scenes = @scenes.map{|scene| "\"#{scene}\""}.join(",")
24
+
25
+ player_settings_opts = {}
26
+ player_settings_opts["bundleIdentifier"] = "\"#{@bundle_identifier}\"" if @bundle_identifier
27
+
28
+ player_settings_opts_string = player_settings_opts.map{|k,v| "PlayerSettings.#{k} = #{v};"}.join("\n")
29
+
24
30
  f.write "using UnityEngine;
25
31
  using UnityEditor;
26
32
  using System.Collections;
@@ -29,6 +35,7 @@ public class #{@class_name}
29
35
  private static string[] scene = {#{scenes}};
30
36
  public static void Build()
31
37
  {
38
+ #{player_settings_opts_string}
32
39
  BuildOptions opt = BuildOptions.SymlinkLibraries;
33
40
  /*string errorMsg = */BuildPipeline.BuildPlayer(scene, \"#{@output_directory}\", BuildTarget.iPhone,opt);
34
41
  EditorApplication.Exit(0);
@@ -42,7 +49,7 @@ public class #{@class_name}
42
49
  end
43
50
 
44
51
  def run_unity_command
45
- `/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
52
+ `/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchMode -executeMethod #{@class_name}.Build -projectPath #{@root_directory}`
46
53
  end
47
54
 
48
55
  def run
@@ -1,3 +1,3 @@
1
1
  module Echinoidea
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echinoidea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: