private void Update()
 {
     string txt = "";
     foreach(GameEntity entity in _playerGroup.GetEntities())
     {
         int playerId = entity.playerId.value;
         FixVec2 pos = entity.position.value;
         Fix64 dir = entity.direction.value;
         txt += playerId + " " + pos.ToVector2().ToString(Config.PrecisionFormat) + " " + ((float)dir).ToString(Config.PrecisionFormat) + "\n";
     }
     _infoTxt.text = txt;
 }
示例#2
0
    private void FixVec2Test()
    {
        Debug.Log("------------FixVec2Test-----------");
        FixVec2 res1 = new FixVec2(2.222f, 4.444f);

        Debug.Log(res1);
        res1 = res1.Normalize();
        Debug.Log(res1);
        Debug.Log(res1.ToVector2().ToString("f3"));

        Vector2 res2 = new Vector2(2.222f, 4.444f);

        Debug.Log(res2.ToString("f3"));
        res2.Normalize();
        Debug.Log(res2.ToString("f3"));
        Debug.Log("\n");
    }