Search Unity

how use update function in custom editor

Discussion in 'General Discussion' started by dahiyabunty1, May 21, 2020.

  1. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    pls give neat and clean code
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
  3. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    not worked..
     
  4. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    negnifity... can u tell me in which situation editor scriptting is very useful
     
  5. dahiyabunty1 likes this.
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    The manual page I linked has an example.

    In edit mode Update() is not called continuously, even if you use ExecuteInEditMode, only when something changes in the viewport. Additionally, coroutines are disabled. In this scenario, typically you put your initialization code into OnEnable, and your deinitialization code into OnDisable. Those functions will be called often.
     
    dahiyabunty1 likes this.
  7. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    thank... but if any solution...
    Code (CSharp):
    1. void update()
    2. {
    3. move player per frame
    4. }