Search Unity

Find Device in script

Discussion in 'iOS and tvOS' started by AdsySingle, Oct 3, 2011.

  1. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    I have a number of different builds happening at the moment, one for the iphone/ipod, one for ipad and one for android. The upkeep is becoming a pain and I would like to modify my code base to be able to support all three and let me simply copy and paste into the different projects.

    I am aware of the #if IPHONE_UNITY and #if IPHONE_ANDROID and I know of the iPhoneSettings.generation to get the iOS device.

    My problem is I have some vectors (for example) that are defined and declared at the start of the script, but when I place them inside of these # statements and set them all up individually for each build the functions that use them no longer recognise them as being in scope.

    Is there a way to do what I am trying to do?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Are you sure that you declare the variable outside the scope with a default value assigned so it does not warn you due to being unassigned when used?