x


How can I exclude part of a script when building for iPhone?

Hey, so I have my complicated system which only works on desktop, but I want the game to work on iPhone too so I made a simple replacement in the script. My problem is even if I use an if statement with Application.Platform it won't compile, and I don't want to be switching scripts every time I build, what is the solution for this?

more ▼

asked Aug 18 '12 at 07:14 AM

Pandiux gravatar image

Pandiux
137 17 29 35

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Have you tried this

#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
( move all your desktop portion of the script here )
#else
( move all your iphone part here )
#endif
more ▼

answered Aug 18 '12 at 03:48 PM

Sundar gravatar image

Sundar
581 2 2

How could I forget about this -.-, Thanks :) This helped me a lot.

Aug 18 '12 at 07:02 PM Pandiux
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1999
x204
x74

asked: Aug 18 '12 at 07:14 AM

Seen: 263 times

Last Updated: Aug 18 '12 at 07:02 PM