• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DoitStudioss · May 22, 2017 at 03:31 AM · assetplatformplatformsspecificdeselect

One Unity-Project for Windows, Android and IOS with specific folders for example for import Play Service Asset for Android.

Hi there,

I wanted to know if its possible to deselect folders or assets for specific platforms. In my case I've made a game for Windows and Android in one Project and switching the platform and start the game worked fine. But when I import the Play Services for Android to the Project I cant start/build etc. for Windows any more because of the Play Service folder and Scripts in there.

Is there any solution for such a problem. I don't want to create a other project for Windows because its very uncomfortable.

Thank you for your answers :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by RobAnthem · May 22, 2017 at 03:34 AM

You have to encapsulate your code into pre-processor directives that only compile if certain conditions are met. For example you can omit editor-only scripts from compiling, or android-only scripts when not compiling to android. The list of directives can be found here.

Platform Specific Directives

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DoitStudioss · May 24, 2017 at 08:21 AM 0
Share

Thank you, that looks great and exactly what I need! I will give it a try :)

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Locomtion System with platforms 0 Answers

how to download Asset Bundles from website to Application.dataPath across platforms ? 1 Answer

Any asset to help me achieve "Resolution specific sprites", how? 1 Answer

A place to specify my asset's supported platforms when publishing. 0 Answers

How to detect if unity build scene for target platform or editor player 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges