LogError() public static method

public static LogError ( object message ) : void
message object
return void
        public static object TrySearchGlobalMemberValue(this Type target, string memberName)
        {
            FieldInfo field = target.TryGetGlobalFieldInfo(memberName);

            if (field != null)
            {
                return(field.GetValue(null));
            }
            PropertyInfo property = target.TryGetGlobalPropertyInfo(memberName);

            if (null != property)
            {
                return(property.GetValue(null, null));
            }
            MethodInfo method = target.TryGetGlobalMethodInfo(memberName);

            if (null != method)
            {
                return(method.Invoke(null, null));
            }
            EventInfo eventInfo = target.TryGetGlobalEventInfo(memberName);

            if (null != eventInfo)
            {
                return(eventInfo);
            }
            XLogger.LogError(string.Format("Search Member Not Found \"{0}\".", memberName));
            return(null);
        }
        public static Type TrySearchMember(this Type target, string memberName)
        {
            FieldInfo field = target.TryGetFieldInfo(memberName);

            if (field != null)
            {
                return(field.FieldType);
            }
            PropertyInfo property = target.TryGetPropertyInfo(memberName);

            if (null != property)
            {
                return(property.PropertyType);
            }
            MethodInfo method = target.TryGetMethodInfo(memberName);

            if (null != method)
            {
                return(method.ReturnType);
            }
            EventInfo eventInfo = target.TryGetEventInfo(memberName);

            if (null != eventInfo)
            {
                return(eventInfo.EventHandlerType);
            }
            XLogger.LogError(string.Format("Search Member Not Found \"{0}\".", memberName));
            return(null);
        }
        public static Assembly TryGetAssembly(string assemblyName, bool isPrecise = true)
        {
            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();


            for (int pos = 0; pos < assemblies.Length; pos++)
            {
                //  TODO loop in assemblies.Length
                string currAssem = StringUtils.CutOnCharLeft(assemblies[pos].ManifestModule.Name, ".");
                if (isPrecise)
                {
                    if (currAssem.Equals(assemblyName))
                    {
                        return(assemblies[pos]);
                    }
                }
                else
                {
                    if (currAssem.Contains(assemblyName) || assemblyName.Contains(currAssem))
                    {
                        return(assemblies[pos]);
                    }
                }
            }
            XLogger.LogError(string.Format("Try Get Assembly {0} Not Found!", assemblyName));
            return(null);
        }
Example #4
0
 public void RollbackLastState()
 {
     if (lastState != null)
     {
         XLogger.LogError("Rollback State : " + currState.Name + "," + lastState.Name);
         nextState = lastState;
         lastState = null;
     }
 }
Example #5
0
 /// <summary>
 /// 残弾数の減算
 /// </summary>
 /// <param name="val">追加量:(value > 0)</param>
 public void SubBullet(int val)
 {
     XLogger.LogValidObject(val <= 0, "Invalid Argument MagazineUnit SubBullet: " + val.ToString());
     bulletNum -= val;
     if (bulletNum < 0)
     {
         bulletNum = 0;
         XLogger.LogError("Bullet Overflow");
     }
     XLogger.Log("Magazine SubBullet: " + val.ToString() + "  " + bulletNum.ToString() + "/" + capacity.ToString());
 }
Example #6
0
        public void LoggerEaseOfUse()
        {
            var expected = "testing";
            var myLogger = new XLogger();

            myLogger.LogInfo(expected);
            myLogger.LogError(expected);

            Assert.NotNull(myLogger);
            Assert.Equal(2, myLogger.OutputDocument.Root.Elements(XLogger.EntryElementName).Count());
            Assert.Equal(expected, myLogger.OutputDocument.Root.Element(XLogger.EntryElementName).Element(XLogger.DescriptionElementName).Value);
            Assert.Equal(expected, myLogger.OutputDocument.Root.Elements(XLogger.EntryElementName).Last().Element(XLogger.DescriptionElementName).Value);
        }
 // Update is called once per frame
 void Update()
 {
     if (m_viewer == null)
     {
         XLogger.LogError("DbgSys:No Initialized", gameObject);
         return;
     }
     if (m_prevEnableView != m_viewer.enableView)
     {
         EnableView(m_viewer.enableView);
         m_prevEnableView = m_viewer.enableView;
     }
 }
Example #8
0
 protected override void CoordinateCollider(Transform transParent)
 {
     m_obstacle = transParent.GetComponent <NavMeshObstacle>();
     XLogger.LogValidObject(m_obstacle, "DbgSys:GetComponent<NavMeshObstacle:Box>", gameObject);
     if (m_obstacle.shape == NavMeshObstacleShape.Box)
     {
         this.transform.localPosition = m_obstacle.center;
         this.transform.localScale    = m_obstacle.size;
         this.transform.rotation      = transParent.rotation;
     }
     else
     {
         XLogger.LogError("Invalid NavMeshObstacle: type=Capsule");
     }
 }
 /// <summary>
 /// Tries the get class.
 /// </summary>
 /// <returns>The get class.</returns>
 /// <param name="className">Class name.</param>
 public static Type TryGetClass(string className)
 {
     Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
     for( int pos = 0; pos < assemblies.Length; pos++ ) {
         //  TODO loop in Length
         var types = assemblies[pos].GetTypes();
         for( int idx = 0; idx < types.Length; idx++ ) {
             //  TODO loop in types.Length
             if( types[idx].Name.Equals( className, ignoreCase ) || types[idx].Name.Contains( '+' + className ) ) //+ check for inline classes
             return types[idx];
         }
     }
     XLogger.LogError( "Try Get Class Not Found!" );
     return null;
 }
 protected override void CoordinateCollider(Transform transParent)
 {
     m_obstacle = transParent.GetComponent <NavMeshObstacle>();
     XLogger.LogValidObject(m_obstacle, "DbgSys:GetComponent<NavMeshObstacle:Capsule>", gameObject);
     if (m_obstacle.shape == NavMeshObstacleShape.Capsule)
     {
         this.transform.localPosition = m_obstacle.center;
         float size = m_obstacle.radius * 2.0f;
         this.transform.localScale    = new Vector3(size, m_obstacle.height * 0.50f, size);
         this.transform.localRotation = transParent.localRotation;
     }
     else
     {
         XLogger.LogError("Invalid NavMeshObstacle: type=Box");
     }
 }
Example #11
0
        public void XLoggerLogError()
        {
            var expected         = "testing";
            var myLogger         = new XLogger();
            var loggedApproxDate = DateTime.Now;

            myLogger.LogError(expected);

            Assert.Single(myLogger.OutputDocument.Root.Elements(XLogger.EntryElementName));
            Assert.Equal(MessageSeverity.Error.ToString(), myLogger.OutputDocument.Root.Element(XLogger.EntryElementName).Element(XLogger.TypeElementName).Value);
            Assert.Equal(expected, myLogger.OutputDocument.Root.Element(XLogger.EntryElementName).Element(XLogger.DescriptionElementName).Value);
            if (loggedApproxDate.Minute != 59 || loggedApproxDate.Second < 59 || loggedApproxDate.Millisecond < 999)
            {
                Assert.Equal(loggedApproxDate.ToString("yy-MM-dd-HH"),
                             Convert.ToDateTime(myLogger.OutputDocument.Root.Element(XLogger.EntryElementName).Element(XLogger.TimeElementName).Value).ToString("yy-MM-dd-HH"));
            }
        }
    void Awake()
    {
        XLogger.LogError("Illegal Awake! TestCS", gameObject);

        XLogger.LogValidObject(m_parent == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Parent"), gameObject);
        XLogger.LogValidObject(m_bullet == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Ballte"), gameObject);
        XLogger.LogValidObject(m_bulletBouquet == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("BallteBouquet"), gameObject);
        XLogger.LogValidObject(m_hitPoint == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("HitPoint"), gameObject);

        XLogger.LogValidObject(m_efReload == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Effect Reload"), gameObject);
        XLogger.LogValidObject(m_efMaxCharge == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Effect MaxCharge"), gameObject);

        m_magazine     = this.GetComponent <LauncherMagazine>();
        m_lineRenderer = this.GetComponent <LineRenderer>();

        GameObject efObj       = XFunctions.InstanceChild(m_efMaxCharge, Vector3.zero, Quaternion.identity, this.gameObject);
        GameObject efReloadObj = XFunctions.InstanceChild(m_efReload, Vector3.zero, Quaternion.identity, this.gameObject);

        m_csEfMaxCharge = efObj.GetComponent <IEffect>();
        m_csEfReload    = efReloadObj.GetComponent <IEffect>();
    }
Example #13
0
 void Awake()
 {
     XLogger.LogError("Illegal Awake! TestCS", gameObject);
 }
Example #14
0
    void Update()
    {
        accelerrateTime += Time.deltaTime;

        //----
        if (accelerrateTime > timeInterval)
        {
            bossMoveSpeed += accelerrate;
            if (bossMoveSpeed > bossSpeedLimit)
            {
                bossMoveSpeed = bossSpeedLimit;
            }
            accelerrateTime -= timeInterval;
        }
        //-----
        gameTime += Time.deltaTime;
        if (gameTime < DelayEnterTime || isFinishGame)
        {
            return;
        }
        var currentPlayer = players[CurrentBallIndex];
        var cheatPoint    = ballPoint[CurrentBallIndex].position;

        ballSprite.sortingOrder = currentPlayer.As <SpriteRenderer>().sortingOrder + 1;

        ball.transform.position = Vector3.MoveTowards(ball.transform.position, cheatPoint, Time.deltaTime * ballMoveSpeed);

        patrolTime += Time.deltaTime;

        var bossPos = boss.transform.position;
        var ballPos = ball.transform.position;

        holdTime += Time.deltaTime;

        if (holdTime > 2 && isHighScore == false)
        {
            if (currentPlayer.animator.GetBool("isHurry"))
            {
                Score            += 5;
                fadeOutLabel.text = "+5";
                currentPlayer.animator.SetBool("isHurry", false);
                AudioManager.Inst.PlayLaugh3();
            }
            else
            {
                Score            += 3;
                fadeOutLabel.text = "+3";

                var rand = Random.Range(0, 2);
                if (rand == 0)
                {
                    AudioManager.Inst.PlayLaugh1();
                }
                else
                {
                    AudioManager.Inst.PlayLaugh2();
                }
            }

            holdTime = 0;
            var position = currentPlayer.transform.position;
            var uiPos    = mainCamera.WorldToScreenPoint(position);
            uiPos.z = 1;
            fadeOutLabel.transform.position = uiPos;
            var locaPosY = fadeOutLabel.transform.localPosition.y;
            fadeOutLabel.color = fadeOutLabel.color.SetAlpha(1);
            fadeOutLabel.transform.DOMoveY(uiPos.y + 100, 0.8f);
            fadeOutLabel.DOFade(0, 0.8f);
            isHighScore = true;
        }
        else if (holdTime > 1 && isHighScore == true)
        {
            Score   += 2;
            holdTime = 0;
            var position = currentPlayer.transform.position;
            var uiPos    = mainCamera.WorldToScreenPoint(position);
            uiPos.z = 1;
            fadeOutLabel.transform.position = uiPos;
            fadeOutLabel.color = fadeOutLabel.color.SetAlpha(1);
            fadeOutLabel.transform.DOMoveY(uiPos.y + 100, 0.8f);
            fadeOutLabel.text = "+2";
            fadeOutLabel.DOFade(0, 0.8f);
        }

        if (patrolTime > patrolLimitTime)
        {
            boss.isAngry = true;
            AudioManager.Inst.PlayAngry();
            boss.transform.position =
                Vector3.Lerp(bossPos, ballPos, Time.deltaTime * bossMoveSpeed);
            boss.SetTarget(ballPos);
            bool isFilp = bossPos.x < ballPos.x;
            boss.isFilpX = isFilp;
        }
        else
        {
            boss.isAngry = false;
//			XLogger.Log( currentPlayer.neighborPoint[ bossMoveableIndex ].name, currentPlayer.neighborPoint[ bossMoveableIndex ].gameObject );
            var movePoint = currentPlayer.neighborPoint[bossMoveableIndex].position;
            boss.transform.position =
                Vector3.Lerp(bossPos, movePoint, Time.deltaTime * bossMoveSpeed);
            boss.SetTarget(movePoint);
            var manguite = (bossPos - movePoint).magnitude;
//			XLogger.Log( manguite );

            if (manguite < 1f)
            {
                bossMoveableIndex = Random.Range(0, 3);
            }


            bool isFilp = bossPos.x < movePoint.x;
            boss.isFilpX = isFilp;
        }
        if (boss.isInSector(ball.transform.position))
        {
            XLogger.LogError("FinishGame");
            isFinishGame = true;
            boss.SetCatch();
            bool isFilp = bossPos.x < ballPos.x;
            boss.isFilpX = isFilp;
            AudioManager.Inst.PlayCatch();

            AudioManager.Inst.StopPlaying();
            AudioManager.Inst.PlayFail();
            AudioManager.Inst.PlayTeacherLaugh();

            StopAllCoroutines();
            ball.transform.position = boss.catchPoint(isFilp);
            ballSprite.sortingOrder = 1000;
            for (int i = 0; i < players.Length; i++)
            {
                var c = players[i];
                if (c == lastPlayer)
                {
                    c.Cry();
                }
                else
                {
                    c.Win();
                }
            }
            lastPlayer.Cry();
            Invoke("DelayFinish", 4);
        }

//		var buttonUp = Input.GetMouseButtonUp( 0 );
//		if( buttonUp )
//		{
//			var mousePos = Input.mousePosition;
//			var mainCamera = Camera.main;
//			for( int i = 0; i < players.Length; i++ )
//			{
//				var rect = players[ i ].As<SpriteRenderer>();
//				var spriteRect = new Rect(players[i].transform.position, rect.size);
////				if( rect.bounds.Contains( mousePos ) )
////				{
////					XLogger.Log( i );
////					FireBall( i );
////					break;
////				}
//////				if( RectTransformUtility.RectangleContainsScreenPoint( rect, mousePos ) )
//////				{
//////					XLogger.Log( i );
//////					FireBall( i );
//////					break;
//////
//////				}
//////				if( rect.rect.Contains( mousePos ) )
//////				{
//////					XLogger.Log( i.ToString() );
//////					FireBall( i );
//////					break;
//////
//////				}
//
//			}
//		}
    }