Search Unity

Communicate with server through Editor script

Discussion in 'Scripting' started by carnevalle, Nov 9, 2010.

  1. carnevalle

    carnevalle

    Joined:
    Jun 25, 2009
    Posts:
    39
    I have tried searching the forum for answers to this without any luck.

    I am working on an editor script (a custom editor) that should be able to fetch data from a database

    We are saving different feedback from our game while playing the game, and I want to be able to fetch this data in the editor, so I can add the feedback to level in our editor. This could be data like where a player dies, sections with critical frame rates and so on.

    As I understand it the www operates through a Coroutine, but running coroutines are restricted to MonoBehaviours. So how would I communicate with a server through an editor script?
     
  2. carnevalle

    carnevalle

    Joined:
    Jun 25, 2009
    Posts:
    39
    I fixed it by letting the GameObject do the communication.

    I enabled [ExecuteInEditMode] and let the custom inspector do a EditorUtility.SetDirty() on the GameObject while communicating to make sure, that the update function was called.