Search Unity

[Knowledge Share] Simple Chat GUI Controller

Discussion in 'Immediate Mode GUI (IMGUI)' started by Abu-Faisal, Mar 27, 2014.

  1. Abu-Faisal

    Abu-Faisal

    Joined:
    Sep 11, 2013
    Posts:
    15
    While learning about GUI, I did a class that create a simple chat controller using Unity3d GUI only. To use this class, just derive from it. this class gives 2 events and uses 1 field of derived class. as follow,

    • ChatSkin : GUISkin variable that will be used to skin chat controller.
    • void OnChatGUI() : to draw GUI elements in this class. Note: don't use OnGUI() in this class or it will override the ChatController OnGUI().
    • void OnChatClicked(string word, string line) : an event that will gives word and line that which were clicked using left button of the mouse inside ChatArea.

    I hope this class is useful for someone.
     

    Attached Files:

    • $Chat.cs
      File size:
      5.3 KB
      Views:
      868
    • $Test.cs
      File size:
      494 bytes
      Views:
      789