コード例 #1
0
 public void Info(object obj)
 {
     if (_level != Level.Info)
     {
         return;
     }
     _logger.Log(_globalContext, obj.ToString());
 }
コード例 #2
0
 private void Start()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "SessionResultAnimation Start.");
     try
     {
         text = GetComponent <Text>();
         if (Menu.SessionList == null)
         {
             text.text = "No Data";
             return;
         }
         else
         if (Menu.SessionList.Sessions.Count != 0)
         {
             text.text = getLastObjectInformation();
         }
         else
         {
             text.text = "No Data";
         }
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #3
0
ファイル: Score.cs プロジェクト: BartoshMaxim/Labyrinth
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Score Start.");

            _session = GameObject.Find(Session.Session.sessionGameObjectName).GetComponent <Session.Session>();
            _text    = GetComponent <Text>();
        }
コード例 #4
0
 public Mummy(int id, GameObject mummy, Func <GameObject, GameObject> create)
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(MummyClassName, "Mummy Creates.");
     _mummy = mummy;
     Id     = id;
     create(_mummy);
 }
コード例 #5
0
        public Zombie(int id, GameObject zombie, Func <GameObject, GameObject> create)
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(ZombyClassName, "Zombie Creates.");

            _zombie = zombie;
            Id      = id;
            create(_zombie);
        }
コード例 #6
0
        public GamePlayer(string name, float speed, GameObject player)
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "GamePlayer Creates.");

            TimeCreate = DateTime.Now;
            _coins     = 0;
            _player    = player;
            Name       = name;
            Speed      = speed;
        }
コード例 #7
0
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Session Start.");

            _rand           = new System.Random();
            _coins          = new List <IBonus>();
            _enemies        = new List <IEnemy>();
            _timer          = new Timer(5000);
            _timer.Elapsed += coinGeneratorControl;
            SessionStart    = false;
        }
コード例 #8
0
 static public int Log__Object(IntPtr l)
 {
     try {
         UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
         System.Object      a1;
         checkType(l, 2, out a1);
         self.Log(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #9
0
 public void Save()
 {
     try
     {
         _logger.Log(_tag, "SessionList Save.");
         var serializer = new XmlSerializer(typeof(SessionList));
         using (var stream = new FileStream(Path.Combine(Application.dataPath, "session_list.xml"), FileMode.Create))
         {
             serializer.Serialize(stream, this);
         }
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #10
0
ファイル: Coin.cs プロジェクト: BartoshMaxim/Labyrinth
 public Coin(GameObject coin, Func <GameObject, GameObject> create)
 {
     try
     {
         _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
         _logger.Log(tag, "Coin " + _id + " Create.");
         _coin = coin;
         Id    = id;
         id++;
         _coin.GetComponent <CoinUpdate>().Income = Income;
         create(_coin);
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #11
0
 static public int Log__LogType__String__Object(IntPtr l)
 {
     try {
         UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
         UnityEngine.LogType a1;
         checkEnum(l, 2, out a1);
         System.String a2;
         checkType(l, 3, out a2);
         System.Object a3;
         checkType(l, 4, out a3);
         self.Log(a1, a2, a3);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #12
0
 private void Start()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "SessionResultAnimation Start.");
     try
     {
         if (File.Exists(Path.Combine(Application.dataPath, "session_list.xml")))
         {
             SessionList = SessionList.Load();//read data from xml
         }
         else
         {
             SessionList = new SessionList();
         }
     }
     catch (System.Exception e)
     {
         _logger.LogException(e);
     }
 }
コード例 #13
0
        private void Start()
        {
            _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
            _logger.Log(_tag, "Statistics Start.");

            try
            {
                _textResult = GetComponent <Text>();

                if (File.Exists(Path.Combine(Application.dataPath, "session_list.xml")))
                {
                    _textResult.text = getTable(SessionList.Load().Sessions);
                }
                else
                {
                    _textResult.text = "No data";
                }
            }
            catch (System.Exception e)
            {
                _logger.LogException(e);
            }
        }
コード例 #14
0
 private void Start()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "Settings Start.");
 }
コード例 #15
0
        public static void Log(string message)
        {
#if DEBUG
            u_logger.Log(LogType.Log, message);
#endif
        }
コード例 #16
0
 static public int Log(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.Object      a1;
             checkType(l, 2, out a1);
             self.Log(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object)))
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(string), typeof(System.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             a1 = (UnityEngine.LogType)LuaDLL.luaL_checkinteger(l, 2);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             UnityEngine.Object a4;
             checkType(l, 5, out a4);
             self.Log(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Log to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #17
0
 public SessionList()
 {
     _logger = new UnityEngine.Logger(new LabyrinthLogHandler());
     _logger.Log(_tag, "SessionList Create.");
 }
コード例 #18
0
 static public int Log(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.Object      a1;
             checkType(l, 2, out a1);
             self.Log(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object)))
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             self.Log(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.Logger self = (UnityEngine.Logger)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(System.Object), typeof(UnityEngine.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             UnityEngine.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.LogType), typeof(string), typeof(System.Object)))
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             self.Log(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.Logger  self = (UnityEngine.Logger)checkSelf(l);
             UnityEngine.LogType a1;
             checkEnum(l, 2, out a1);
             System.String a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             UnityEngine.Object a4;
             checkType(l, 5, out a4);
             self.Log(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Log to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #19
0
    public static int Log(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 2)
            {
                UnityEngine.Logger logger = (UnityEngine.Logger)LuaObject.checkSelf(l);
                object             message;
                LuaObject.checkType <object>(l, 2, out message);
                logger.Log(message);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, num, 2, typeof(string), typeof(object)))
            {
                UnityEngine.Logger logger2 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                string             tag;
                LuaObject.checkType(l, 2, out tag);
                object message2;
                LuaObject.checkType <object>(l, 3, out message2);
                logger2.Log(tag, message2);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, num, 2, typeof(LogType), typeof(object)))
            {
                UnityEngine.Logger logger3 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType;
                LuaObject.checkEnum <LogType>(l, 2, out logType);
                object message3;
                LuaObject.checkType <object>(l, 3, out message3);
                logger3.Log(logType, message3);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, num, 2, typeof(string), typeof(object), typeof(UnityEngine.Object)))
            {
                UnityEngine.Logger logger4 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                string             tag2;
                LuaObject.checkType(l, 2, out tag2);
                object message4;
                LuaObject.checkType <object>(l, 3, out message4);
                UnityEngine.Object context;
                LuaObject.checkType <UnityEngine.Object>(l, 4, out context);
                logger4.Log(tag2, message4, context);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, num, 2, typeof(LogType), typeof(object), typeof(UnityEngine.Object)))
            {
                UnityEngine.Logger logger5 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType2;
                LuaObject.checkEnum <LogType>(l, 2, out logType2);
                object message5;
                LuaObject.checkType <object>(l, 3, out message5);
                UnityEngine.Object context2;
                LuaObject.checkType <UnityEngine.Object>(l, 4, out context2);
                logger5.Log(logType2, message5, context2);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (LuaObject.matchType(l, num, 2, typeof(LogType), typeof(string), typeof(object)))
            {
                UnityEngine.Logger logger6 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType3;
                LuaObject.checkEnum <LogType>(l, 2, out logType3);
                string tag3;
                LuaObject.checkType(l, 3, out tag3);
                object message6;
                LuaObject.checkType <object>(l, 4, out message6);
                logger6.Log(logType3, tag3, message6);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (num == 5)
            {
                UnityEngine.Logger logger7 = (UnityEngine.Logger)LuaObject.checkSelf(l);
                LogType            logType4;
                LuaObject.checkEnum <LogType>(l, 2, out logType4);
                string tag4;
                LuaObject.checkType(l, 3, out tag4);
                object message7;
                LuaObject.checkType <object>(l, 4, out message7);
                UnityEngine.Object context3;
                LuaObject.checkType <UnityEngine.Object>(l, 5, out context3);
                logger7.Log(logType4, tag4, message7, context3);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function Log to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }