Class: Pindo::TaskSystem::UnityExportTask
- Defined in:
- lib/pindo/module/task/model/unity/unity_export_task.rb
Overview
Unity 导出任务用于将 Unity 项目导出为指定平台(iOS/Android/WebGL)
Instance Attribute Summary collapse
-
#deploy_mode ⇒ Object
readonly
Returns the value of attribute deploy_mode.
-
#export_path ⇒ Object
readonly
Returns the value of attribute export_path.
-
#is_library_mode ⇒ Object
readonly
Returns the value of attribute is_library_mode.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
Attributes inherited from UnityTask
#project_path, #unity_root_path
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #data_dependencies, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #started_at, #status, #task_key, #task_manager, #type
Class Method Summary collapse
-
.task_key ⇒ Object
任务键.
Instance Method Summary collapse
-
#initialize(platform, options = {}) ⇒ UnityExportTask
constructor
A new instance of UnityExportTask.
- #validate ⇒ Object
Methods inherited from UnityTask
#before_retry, default_retry_count, default_retry_delay, default_retry_mode, task_type, task_type_name, #unity_helper
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #data_param, default_retry_count, default_retry_delay, default_retry_mode, #do_task, #execution_time, #finished?, #get_all_data_params, #get_all_data_params_by_key, #get_all_dependencies_results, #get_data_param, #get_data_param_by_key, #get_dependency_result, #get_dependency_task, #on, #primary_data_param, #reset_for_retry, #retryable?, #running?, #should_retry?, task_type
Constructor Details
#initialize(platform, options = {}) ⇒ UnityExportTask
Returns a new instance of UnityExportTask.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 22 def initialize(platform, = {}) @platform = platform @unity_exe_path = nil # 将在 do_work 中自动查找 @is_library_mode = false @index_count = [:context] ? [:context][:index_count] : nil @export_path = [:export_path] # 可由参数传入,nil 表示自动检测 @deploy_mode = [:deploy_mode] || 'dev' # 部署模式:dev/adhoc/release,默认 dev name = case platform when 'ios', 'ipa' "Unity导出iOS平台" when 'android', 'apk' "Unity导出Android平台" when 'web', 'html' "Unity导出WebGL平台" else "Unity导出#{platform.upcase}平台" end # 传递 project_path 给基类 [:project_path] ||= Dir.pwd super(name, ) end |
Instance Attribute Details
#deploy_mode ⇒ Object (readonly)
Returns the value of attribute deploy_mode.
9 10 11 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 9 def deploy_mode @deploy_mode end |
#export_path ⇒ Object (readonly)
Returns the value of attribute export_path.
9 10 11 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 9 def export_path @export_path end |
#is_library_mode ⇒ Object (readonly)
Returns the value of attribute is_library_mode.
9 10 11 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 9 def is_library_mode @is_library_mode end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
9 10 11 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 9 def platform @platform end |
Class Method Details
.task_key ⇒ Object
任务键
12 13 14 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 12 def self.task_key :unity_export end |
Instance Method Details
#validate ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/pindo/module/task/model/unity/unity_export_task.rb', line 46 def validate super # 验证 Unity 工程是否存在 unless unity_helper.unity_project?(@unity_root_path) raise Informative, "当前目录不是 Unity 工程:#{@unity_root_path}" end true end |