Search Unity

OnClick() 4.6 BETA - Help

Discussion in 'Immediate Mode GUI (IMGUI)' started by SpectrumWolf, Nov 25, 2014.

  1. SpectrumWolf

    SpectrumWolf

    Joined:
    Aug 1, 2013
    Posts:
    8
    Code (CSharp):
    1.     public void Example(string MyParent) {
    2.                 Debug.Log(MyParent);
    3.     }
    So I tried this, and set it up like explained in this vid on how to use the OnClick().



    However, when I test it, nothing happens, so I was wondering if it my code or something.
     
  2. NickHaldon

    NickHaldon

    Joined:
    Mar 19, 2014
    Posts:
    128
    I couldn't find the part in the video that talked about this but it seems to me that you need a comma after string and parentheses before and after MyParent.

    So try something like this,
    Code (csharp):
    1.  
    2. public void example (string, MyParent){
    3. Debug.Log ("MyParent");
    4. }
    5.