Search Unity

How to activate script instances using GUITexture and GUIButton in C#

Discussion in 'Immediate Mode GUI (IMGUI)' started by Exnihilon, Apr 18, 2014.

  1. Exnihilon

    Exnihilon

    Joined:
    Mar 2, 2014
    Posts:
    158
    Hello to all. I need a little help with some scripting in C#, cause I am new to Unity and scripting in general. Here is what I want to achieve:

    I have a script named "ScriptA" attached to a GameObject named "MarkerObject". I also have a GUITexture and a GUIButton rendered in scene.

    What I want to do, is calling the attached script on GameObject once I touch the GUITexture button, and in the case the GUIButton is touched. I have the code for touching function. I only want some snippet of the script calling function.

    Could anyone be kind enough, to post a snippet code similar to this posted in here, but in C#:

    http://answers.unity3d.com/questions/30987/using-gui-button-to-activate-script-instances.html

    Thank you all, waiting for your answers.