예제 #1
0
        private void SetField(Dictionary <EntityId, List <EntitySnapshot> > shots)
        {
            FieldCreator.Reset();

            int snapShotCount = 0;

            foreach (var kvp in shots)
            {
                foreach (var snap in kvp.Value)
                {
                    Position.Snapshot position;
                    if (snap.TryGetComponentSnapshot(out position) == false)
                    {
                        continue;
                    }

                    FieldComponent.Snapshot field;
                    if (snap.TryGetComponentSnapshot(out field) == false)
                    {
                        continue;
                    }

                    FieldCreator.RealizeField(field.TerrainPoints, position.Coords, this.BasePosition);
                    snapShotCount++;
                }
            }

            DebugUtils.LogFormatColor(UnityEngine.Color.red, "FieldWorkerType:{0} RealizeSnapShot.Count:{1}",
                                      this.FieldWorkerType, snapShotCount);

            FieldCreator.RemoveFields();
        }
        private void SetField(List <EntitySnapshot> snapShots)
        {
            FieldCreator.Reset();

            foreach (var snap in snapShots)
            {
                Position.Snapshot position;
                if (snap.TryGetComponentSnapshot(out position) == false)
                {
                    return;
                }

                FieldComponent.Snapshot field;
                if (snap.TryGetComponentSnapshot(out field) == false)
                {
                    return;
                }

                FieldCreator.RealizeField(field.TerrainPoints, position.Coords, this.BasePosition);
            }

            FieldCreator.RemoveFields();
        }