public override void Deserialize(NetworkReader reader)
        {
            ImageTargetIndex = reader.ReadInt32();
            StepOrder        = reader.ReadUInt32();

            var application = Object.FindObjectOfType <Base.Application>();

            Data = Object.Instantiate(application.Prefabs.StepModelPrefab);
            var data = new MemoryStream(reader.ReadBytes(reader.Length - 8));

            Data.Deserialize(new BinaryReader(data));
        }
        private void NewHintWindowController_OnEndCreate(object sender, NewHintWindowController.WindowDataEventArgs eventArgs)
        {
            // Create hint model:
            HintModel hintModel;

            if (eventArgs.HintType == HintType.Text)
            {
                hintModel = StepModel.CreateHint(TextHintModelPrefab);
            }
            else if (eventArgs.HintType == HintType.Image)
            {
                var imageHintModel = StepModel.CreateHint(ImageHintModelPrefab);
                imageHintModel.ImageHintType = (ImageHintType)eventArgs.HintTypeID;
                hintModel = imageHintModel;
            }
            else if (eventArgs.HintType == HintType.Geometry)
            {
                var geometryHintModel = StepModel.CreateHint(GeometryHintModelPrefab);
                geometryHintModel.ModelID = eventArgs.HintTypeID;
                hintModel = geometryHintModel;
            }
            else
            {
                throw new NotSupportedException();
            }

            hintModel.Name = eventArgs.Name;

            // Orient hint to camera:
            {
                var selectedCamera = CameraManager.SelectedCamera;
                var worldPosition  = CameraUtilities.InFrontOfCameraPosition(selectedCamera);
                hintModel.LocalPosition = Application.View.SceneRoot.transform.InverseTransformPoint(worldPosition);

                if (hintModel.Type != HintType.Geometry)
                {
                    hintModel.LocalRotation = CameraUtilities.ParallelToCameraRotation(selectedCamera);
                }
            }

            // Get hint controller:
            var hintController = _hints[hintModel.ID];

            if (Showing)
            {
                hintController.Edit();
            }
        }
 public StepModelNetworkMessage(int imageTargetIndex, uint stepOrder, StepModel data)
 {
     ImageTargetIndex = imageTargetIndex;
     StepOrder        = stepOrder;
     Data             = data;
 }
 public StepEventArgs(StepModel stepModel)
 {
     StepModel = stepModel;
 }
 private void StepModel_OnHintDeleted(StepModel sender, HintEventArgs eventArgs)
 {
     DeleteHintController(eventArgs.HintModel.ID);
 }
 private void StepModel_OnHintCreated(StepModel sender, HintEventArgs eventArgs)
 {
     CreateHintController(eventArgs.HintModel);
 }