UnityEngine.Event.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            if (this.isKey)
            {
                if (this.character == '\0')
                {
                    object[] args = new object[] { this.type, this.modifiers, this.keyCode };
                    return UnityString.Format(@"Event:{0}   Character:\0   Modifiers:{1}   KeyCode:{2}", args);
                }
                object[] objArray2 = new object[] { "Event:", this.type, "   Character:", (int) this.character, "   Modifiers:", this.modifiers, "   KeyCode:", this.keyCode };
                return string.Concat(objArray2);
            }
            if (this.isMouse)
            {
                object[] objArray3 = new object[] { this.type, this.mousePosition, this.modifiers };
                return UnityString.Format("Event: {0}   Position: {1} Modifiers: {2}", objArray3);
            }
            if ((this.type == EventType.ExecuteCommand) || (this.type == EventType.ValidateCommand))
            {
                object[] objArray4 = new object[] { this.type, this.commandName };
                return UnityString.Format("Event: {0}  \"{1}\"", objArray4);
            }
            return ("" + this.type);
        }

Usage Example

 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Event obj = (UnityEngine.Event)ToLua.CheckObject(L, 1, typeof(UnityEngine.Event));
         string            o   = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }