Search Unity

UnityPause() question

Discussion in 'iOS and tvOS' started by Juan, Apr 20, 2012.

  1. Juan

    Juan

    Joined:
    May 21, 2009
    Posts:
    142
    I looked though the forums and google for a clear answer to this, but it seems that the things related to xcode and external modifications of unity are very obscure :p

    I have a class where i put my EAGLView, over that i put some cocoa interface that does not interfere with Unity at all.

    Everything is working fine, but now i call an specific view controller and i would like to pause unity.

    If i try to use "UnityPause(TRUE)" in my file it gives me this error:

    "Implicit declaration of function 'UnityPause' is invalid in C99

    Then i realized that my .m file should be in C++ so i changed it to .mm

    And in this case the error is what follows:

    'Use of undeclared identifier UnityPause'

    I import the AppController in my .h file, i tried also to import it in my .mm but i can't make it work.

    Some ideas please?

    Thanks.

    Cheers
     
  2. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,874
    I would just like to say that I have struggled with this problem many times in the past. I would love to hear a concrete solution.
     
  3. bmr2012

    bmr2012

    Joined:
    Apr 18, 2012
    Posts:
    1
    Last edited: Apr 26, 2012
  4. Juan

    Juan

    Joined:
    May 21, 2009
    Posts:
    142
    It seems there is no luck, i'm not receiving any answer at all in my last 4 threads, i don't understand, i'm sure that there are a lot of peope with enough knowledge here to answer :p
     
  5. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,085
    I call UnityPause inside of the AppController.mm and for calling it outside of AppController.mm I just added a UnityPause and UnityPlay function to AppController.mm
     
  6. Juan

    Juan

    Joined:
    May 21, 2009
    Posts:
    142
    Ok, so if i understood, you create a funciton in AppController.mm and then you import AppController.h into the class where you want to execute the pause, then you call the function you created, right?

    Thanks for the answer :)
     
  7. dferdy

    dferdy

    Joined:
    Jan 30, 2015
    Posts:
    3
    Can you post the snippet if possible?