using UnityEngine;

public class ErrorLogHookManager : MonoBehaviour
{
    [RuntimeInitializeOnLoadMethod]
    static void OnRuntimeMethodLoad()
    {
        new GameObject("ErrorLogHookManager").AddComponent<ErrorLogHookManager>();
    }

    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
    }

    private void OnEnable()
    {
        Application.logMessageReceived += HandleLog;
    }

    private void OnDisable()
    {
        Application.logMessageReceived -= HandleLog;
    }

    void HandleLog(string logString, string stackTrace, LogType type)
    {
#if !FGB_LIVE
        switch (type)
        {
#if !UNITY_EDITOR
            default: Debug.Log(logString); break;
#endif
            case LogType.Error:
            case LogType.Exception:
                Debug.LogError(logString);
                break;
        }
#endif
        }
}

public partial class SROptions
{
#if UNITY_EDITOR
    public int ID { get; set; }
    double _amount = 1000;
    public double Amount { get { return _amount; } set { _amount = value; } }
    public void Add_Item()
    {
        //ServerInfo.Ins.Save_CheatItem(ID, Amount, () => { ServerInfo.Ins.m_ServerData.Add_Item(ID, Amount); });
    }
#endif
}