2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[備忘録]AppController.mmあたりをいじっている時のUnity4.1.5迄からUnity4.2以上に上げる時の注意

Last updated at Posted at 2014-08-25

AppControllerの内容がビルド時に反映されない問題が起きた
原因は

  • AppController.*がビルドされる際にプロジェクトに含まれなくなっていた(正しくないかもしれないけど)

解決方法

今回はopenURLとdidFinishLaunchingWithOptionsの処理に自前の処理を追加したかったので以下のようなスクリプトで書いた。
基本はテラシュールブログさんの内容。
また、loadを含めないではじめやってたら失敗したのでload含めると良い
loadが何かわからない人は下記サイトが参考になる

hogeController
#import "iPhone_target_Prefix.pch"
#import "UnityAppController.h"

// --- HogeController --------------------------------------------------------------------
//

@interface HogeController : UnityAppController
+(void)load;
@end

@implementation HogeController
+(void)load
{
    extern const char* AppControllerClassName;
    AppControllerClassName = "HogeController";
}

// 非推奨
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
    // 処理を記述
    return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    // 処理を記述
    return YES;
}


- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    // 処理を記述
    return YES;
}

なお何故このメソッドが例に出てくるかは分かる人だけ察して下さい。

以上

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?