public void OnEnable()
        {
            console           = (LuviConsole)target;
            logCapacity       = serializedObject.FindProperty(nameof(console.logCapacity));
            excuteCapacity    = serializedObject.FindProperty(nameof(console.excuteCapacity));
            swipeRatio        = serializedObject.FindProperty(nameof(console.swipeRatio));
            defaultFontSize   = serializedObject.FindProperty(nameof(console.defaultFontSize));
            autoShowWarning   = serializedObject.FindProperty(nameof(console.autoShowWarning));
            autoShowError     = serializedObject.FindProperty(nameof(console.autoShowError));
            autoShowException = serializedObject.FindProperty(nameof(console.autoShowException));
            commandLog        = serializedObject.FindProperty(nameof(console.commandLog));

            sb = sb ?? new StringBuilder();
            sb.Clear();
            sb.Append("LuviConsole Version 2.4.3");
            sb.AppendLine();
            sb.Append("https://github.com/LuviKunG/LuviConsole");
            sb.AppendLine();
            sb.AppendLine();
#if UNITY_EDITOR
            sb.Append("In editor, Press F1 for toggle LuviConsole.");
#elif UNITY_EDITOR_OSX
            sb.Append("In editor, Press Tap for toggle LuviConsole.");
#endif
#if UNITY_ANDROID
            sb.AppendLine();
            sb.Append("In your Android device, Swipe up direction in your screen for open LuviConsole. And swipe down for close LuviConsole.");
#elif UNITY_IOS
            sb.AppendLine();
            sb.Append("In your iPhone/iPad/iPod device, Swipe up direction in your screen for open LuviConsole. And swipe down for close LuviConsole.");
#elif UNITY_WEBGL
            sb.AppendLine();
            sb.Append("In your WebGL builds, Press Tap for toggle LuviConsole.");
#endif
        }
Beispiel #2
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        LuviConsole console = (LuviConsole)target;

        console.logCapacity       = EditorGUILayout.IntField(new GUIContent("Log Capacity", "The capacity of list that will show debug log on console window."), console.logCapacity);
        console.excuteCapacity    = EditorGUILayout.IntField(new GUIContent("Log Excuted Command Capacity", "The capacity of excute command that have been excuted."), console.excuteCapacity);
        console.swipeRatio        = EditorGUILayout.Slider(new GUIContent("Swipe Ratio", "The ratio when you swipe up/down on your screen to toggle LuviDebug. 0 when touched, 1 when swipe entire of"), console.swipeRatio, 0f, 1f);
        console.defaultFontSize   = EditorGUILayout.IntSlider(new GUIContent("Default Font Size", "Default font size of console when it getting start."), console.defaultFontSize, 8, 64);
        console.autoShowWarning   = EditorGUILayout.Toggle(new GUIContent("Show Log When Warning", "Automatically show logs when player is get warning log."), console.autoShowWarning);
        console.autoShowError     = EditorGUILayout.Toggle(new GUIContent("Show Log When Error", "Automatically show logs when player is get error log."), console.autoShowError);
        console.autoShowException = EditorGUILayout.Toggle(new GUIContent("Show Log When Exception", "Automatically show logs when player is get exception log."), console.autoShowException);
        _helpResult = "";
#if UNITY_EDITOR_OSX
        _helpResult += _messageOSX;
#elif UNITY_EDITOR
        _helpResult += _messageWin;
#endif
#if UNITY_ANDROID
        _helpResult += "\n" + _deviceAndroid;
#elif UNITY_IOS
        _helpResult += "\n" + _deviceiOS;
#endif
        EditorGUILayout.HelpBox(_helpResult, MessageType.Info);
        serializedObject.ApplyModifiedProperties();
    }
        public void OnEnable()
        {
            console           = (LuviConsole)target;
            logCapacity       = serializedObject.FindProperty(nameof(console.logCapacity));
            excuteCapacity    = serializedObject.FindProperty(nameof(console.excuteCapacity));
            swipeRatio        = serializedObject.FindProperty(nameof(console.swipeRatio));
            defaultFontSize   = serializedObject.FindProperty(nameof(console.defaultFontSize));
            autoShowWarning   = serializedObject.FindProperty(nameof(console.autoShowWarning));
            autoShowError     = serializedObject.FindProperty(nameof(console.autoShowError));
            autoShowException = serializedObject.FindProperty(nameof(console.autoShowException));
            commandLog        = serializedObject.FindProperty(nameof(console.commandLog));
            keys = serializedObject.FindProperty(nameof(console.keys));

            sb = sb ?? new StringBuilder();
            sb.Clear();
            sb.Append(LABEL_VERSION);
            sb.AppendLine();
            sb.Append(LABEL_LINK);
#if UNITY_ANDROID
            sb.AppendLine();
            sb.Append("In your Android device, Swipe up direction in your screen for open LuviConsole. And swipe down for close LuviConsole.");
#elif UNITY_IOS
            sb.AppendLine();
            sb.Append("In your iPhone/iPad/iPod device, Swipe up direction in your screen for open LuviConsole. And swipe down for close LuviConsole.");
#elif UNITY_WEBGL
            sb.AppendLine();
            sb.Append("In your WebGL builds, Use the same assigned button in editor.");
#endif
        }
Beispiel #4
0
    private void Awake()
    {
        // Create or get instance of LuviConsole.
        LuviConsole console = LuviConsole.Instance;

        // Add a new command of '/foo' that will result debug log of 'bar!'
        console.AddCommand("/foo", (args) =>
        {
            Debug.Log("bar!");
        });

        // Add a new command of '/test' that require arguments and will log all available arguments.
        console.AddCommand("/test", (args) =>
        {
            for (int i = 0; i < args.Count; ++i)
            {
                Debug.Log($"args[{i}] = " + args[i]);
            }
        });

        // Add a new command preset of '/foo' that will be show as button below of command input in the group of 'Testing'.
        console.AddCommandPreset("/foo", "Foo", "Just test command of foo", "Testing", false);

        // This is custom log for putting message in console directly without receive debug log.
        console.Log("This is custom log");
        console.Log("This is custom log with color", Color.blue);
        console.Log("This is custom log with bold", true, false);
        console.Log("This is custom log with italic", false, true);
        console.Log("This is custom log with both of bold and italic", true, true);
        console.Log("This is custom log with color and bold", Color.blue, true, false);
        console.Log("This is custom log with color and italic", Color.blue, false, true);
        console.Log("This is custom log with color and both of bold and italic", Color.blue, true, true);
    }
Beispiel #5
0
 void Awake()
 {
     if (!_instance)
     {
         _instance = this;
     }
     Initialize();
     CheckScreenRotation();
 }
Beispiel #6
0
    void CommandAddMoney(string[] value)
    {
        int amount = 0;

        if (int.TryParse(value [1], out amount))
        {
            if (amount > 0)
            {
                PlayerStatus.Money += amount;
                LuviConsole.Log(amount + " added.", italic: true);
            }
            else
            {
                LuviConsole.LogError("cannot add money. paramters should be more than 1");
            }
        }
    }
Beispiel #7
0
 void Awake()
 {
     if (!_instance) _instance = this;
     Initialize();
     CheckScreenRotation();
 }