Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Assets [WIP] SOJU - Script Hot Reloading

Discussion in 'Works In Progress' started by pjccccc, Jul 24, 2019.

  1. pjccccc

    pjccccc

    Joined:
    Oct 7, 2015
    Posts:
    43
    Here's a actual working script hot reloader.
    Since Unity's hot realoding is really not usable at all, I decided to make a new one.

    Features
    • reloads changes at runtime, works as you expected
      • every static field, non-serializable fields are not blown
      • running coroutines wont be stopped
    • works with no additional setup, automatically detects file changes
    • remote modification (Android, iOS)


    Code (CSharp):
    1. public class DisplayText : MonoBehaviour
    2. {
    3.     private Text text;
    4.     private int cnt = 0;
    5.  
    6.     private void Awake()
    7.     {
    8.         text = GetComponent<Text>();
    9.         StartCoroutine(UpdateText());
    10.     }
    11.  
    12.     IEnumerator UpdateText()
    13.     {
    14.         while (true)
    15.         {
    16.             text.text = "ASDFASDF " + (cnt++);
    17.             yield return null;
    18.         }
    19.     }
    20. }
    I'll release a initial version in few weeks.
     
    manpower13 likes this.
  2. pjccccc

    pjccccc

    Joined:
    Oct 7, 2015
    Posts:
    43
    Remote loading between Windows Editor and Android

     
    Peter77 likes this.
  3. paulbettner

    paulbettner

    Joined:
    Jan 13, 2014
    Posts:
    9
    Hi! Any plans to share this soon??
     
    joshcamas likes this.
  4. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,036
    Also extremely interested in this
     
unityunity