コード例 #1
0
def add_resource(pbx_proj_path, pbx_build_file_code, pbx_file_reference_code, pbx_group_code, pbx_resource_code):
  resource_to_add = re.search("/\* (.*) in Resources \*/", pbx_build_file_code[0])
  if not resource_to_add:
    print "Adding Resource stopped because we didn't find the name in {0}".format(pbx_build_file_code[0])
    return

  resource_name = resource_to_add.group(1)
  print "\nAdding Resource {0}".format(resource_name)

  if(os_helper.contains(pbx_proj_path, resource_name)):
    print "{0} already included".format(resource_name)
    return

  os_helper.insert_after(pbx_proj_path, "/* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = ", pbx_build_file_code)
  os_helper.insert_after(pbx_proj_path, '/* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>";', pbx_file_reference_code)
  os_helper.insert_before(pbx_proj_path, "/* SystemConfiguration.framework */,", pbx_group_code)
  os_helper.insert_after_regex(pbx_proj_path, "\t*.* /\* Icon\.png in Resources \*/,", pbx_resource_code)
コード例 #2
0
def create_import(package_to_import, file_path):
    print "\n* Import {0} into {1}".format(package_to_import, file_path)
    os_helper.insert_after(file_path, "package ",
                           ['import {0};'.format(package_to_import)])
コード例 #3
0
def add_into_classes(pbx_proj_path, pbx_build_file_code, pbx_file_reference_code, pbx_group_code, group_folder_reference, pbx_source_build_phase_code):
  os_helper.insert_after(pbx_proj_path, "/* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = ", pbx_build_file_code)
  os_helper.insert_after(pbx_proj_path, '/* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>";', pbx_file_reference_code)
  os_helper.insert_before(pbx_proj_path, "/* UI */ = {", pbx_group_code)
  os_helper.insert_before(pbx_proj_path, "/* Unity */,", group_folder_reference)
  os_helper.insert_before(pbx_proj_path, "/* DisplayManager.mm in Sources */,", pbx_source_build_phase_code)
コード例 #4
0
def insert_onpause(file_path, codeList):
    print "\n* Insert {0} into onPause".format(codeList)
    os_helper.insert_after(file_path, "mUnityPlayer.pause();", codeList)
コード例 #5
0
def insert_onresume(file_path, codeList):
    print "\n* Insert {0} into onResume".format(codeList)
    os_helper.insert_after(file_path, "mUnityPlayer.resume();", codeList)
コード例 #6
0
def insert_oncreate(file_path, codeList):
    print "\n* Insert {0} into onCreate".format(codeList)
    os_helper.insert_after(file_path, "playerView.requestFocus();", codeList)
コード例 #7
0
def insert_ondestroy(file_path, codeList):
    print "\n* Insert {0} into onDestroy".format(codeList)
    os_helper.insert_after(file_path, "super.onDestroy();", codeList)
コード例 #8
0
ファイル: java_helper.py プロジェクト: Foda/unity-plugin
def create_import(package_to_import, file_path):
  print "\n* Import {0} into {1}".format(package_to_import, file_path)
  os_helper.insert_after(file_path, "package ", ['import {0};'.format(package_to_import)])
コード例 #9
0
ファイル: java_helper.py プロジェクト: Foda/unity-plugin
def insert_onresume(file_path, codeList):
	print "\n* Insert {0} into onResume".format(codeList)
	os_helper.insert_after(file_path, "mUnityPlayer.resume();", codeList)
コード例 #10
0
ファイル: java_helper.py プロジェクト: Foda/unity-plugin
def insert_onpause(file_path, codeList):
	print "\n* Insert {0} into onPause".format(codeList)
	os_helper.insert_after(file_path, "mUnityPlayer.pause();", codeList)
コード例 #11
0
ファイル: java_helper.py プロジェクト: Foda/unity-plugin
def insert_ondestroy(file_path, codeList):
	print "\n* Insert {0} into onDestroy".format(codeList)
	os_helper.insert_after(file_path, "super.onDestroy();", codeList)
コード例 #12
0
ファイル: java_helper.py プロジェクト: Foda/unity-plugin
def insert_oncreate(file_path, codeList):
	print "\n* Insert {0} into onCreate".format(codeList)
	os_helper.insert_after(file_path, "playerView.requestFocus();", codeList)