Пример #1
0
        public IEnumerator GetStateTest()
        {
            m_networkTransform.Position = m_expectedPosition;
            m_networkTransform.Rotation = m_expectedRotation;

            yield return(null);

            var state = m_networkTransform.GetState();

            foreach (var property in state.Properties)
            {
                Debug.Log($"{property.Name} : {property.Value}");

                switch (property.Name)
                {
                case "Position":
                    Assert.AreEqual(m_expectedPosition, JsonSerializer.Deserialize <Vector3>(property.Value));

                    break;

                case "Rotation":
                    Assert.AreEqual(m_expectedRotation, JsonSerializer.Deserialize <Quaternion>(property.Value));

                    break;

                default:
                    Assert.Fail();

                    break;
                }
            }
        }