コード例 #1
0
        private void OnEnable()
        {
            var data = writer.Data;

            var update = new BaseUnitPosture.Update();

            update.Interval = IntervalCheckerInitializer.InitializedChecker(inter);

            if (!data.Initialized)
            {
                update.Root = this.transform.rotation.ToCompressedQuaternion();

                var dic = new Dictionary <PosturePoint, PostureData>();
                foreach (var k in unit.GetKeys())
                {
                    var pos = new PostureData(k, unit.GetAllRotates(k));
                    dic.Add(pos.Point, pos);
                }

                update.Posture = new PostureInfo()
                {
                    Datas = dic
                };

                update.Initialized = true;
            }

            writer.SendUpdate(update);
        }
コード例 #2
0
        void PostureChanged(PostureData data)
        {
            PostureTransform posture;

            if (unit.PostureDic.TryGetValue(data.Point, out posture) == false)
            {
                return;
            }

            int index = 0;

            foreach (var r in data.Rotations)
            {
                posture.SetQuaternion(index, r.ToUnityQuaternion());
                index++;
            }
        }