问题描述:

I don’t know how to call function in .cs file from .m file.

Example:

// In file MotoState.cs

public class MotoState : MonoBehaviour {

public static void setMotors()

{

// do something here

}

public static void getMotors()

{

// call function in AppDelegate from here

}

}

// In .m file

@interface UnityAppController : NSObject<UIApplicationDelegate>

{

}

+(void)callSetMotors;

+(void)callThisFromGetMotors;

  1. How to call setMotors() function in .cs file from callSetMotors() function in .m file ?
  2. How to call callThisFromGetMotors() function in .m file from getMotors() in .cs file ?

Here no object reference required. All are static function.

相关阅读:
Top