Ejemplo n.º 1
0
    protected override void Update()
    {
        if (manipulationStarted)
        {
            if (tfGizmo.mainTargetRoot != null && GameObject.ReferenceEquals(tfGizmo.mainTargetRoot.gameObject, Model))
            {
                if (!tfGizmo.isTransforming && updatePose)
                {
                    updatePose = false;

                    if (ActionObjectMetadata.HasPose)
                    {
                        UpdatePose();
                    }
                    else
                    {
                        PlayerPrefsHelper.SavePose("scene/" + SceneManager.Instance.SceneMeta.Id + "/action_object/" + Data.Id + "/pose",
                                                   transform.localPosition, transform.localRotation);
                    }
                }

                if (tfGizmo.isTransforming)
                {
                    updatePose = true;
                }
            }
            else
            {
                manipulationStarted = false;
            }
        }

        base.Update();
    }