Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Compiling Scripts based on Platform to save size

Discussion in 'Scripting' started by KKS21199, Mar 6, 2017.

  1. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    Hi,

    I am developing a game for both mobile and desktop and have wrote certain scripts which are platform dependent. How can I not compile a whole .cs file on a platform but let it compile it on another. I want to have the least possible size on Mobile. Most of my controller scripts and GUI are different for both mobile and desktop platforms (all in different classes) and it seems inefficient to compile all the unused classes into the game.

    Will platform dependent compilation do the job and save size?
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    KKS21199 likes this.
  3. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139