示例#1
0
    static void ResetPosition(MenuCommand command)
    {
        VRUIPositioner target = (VRUIPositioner)command.context;

        Undo.RecordObjects(new Object[] { target, target.transform }, STRING_RESET_POSITION_UNDO);
        target.RelativePosition = Vector3.zero;
        target.SetPositionRelativeToAnchor();
    }
示例#2
0
    private void OnEnable()
    {
        m_target = (VRUIPositioner)target;

        relativePositionProp      = serializedObject.FindProperty("relativePosition");
        relativeEulerRotationProp = serializedObject.FindProperty("relativeRotation");
        relativeEulerRotationProp = serializedObject.FindProperty("relativeEulerRotation");
        anchorProp = serializedObject.FindProperty("anchor");

        VRUIScrollPanelBehaviour parentScrollPanel = null;

        if (m_target.transform.parent)
        {
            parentScrollPanel = m_target.transform.parent.gameObject.GetComponent <VRUIScrollPanelBehaviour>();
        }
        if (parentScrollPanel)
        {
            Tools.hidden       = true;
            m_target.hideFlags = HideFlags.NotEditable;
        }
    }
 // Use this for initialization
 void Start()
 {
     mCanvas    = GetComponent <Canvas>();
     effectFSM  = GetComponent <PlayMakerFSM>();
     positioner = GetComponent <VRUIPositioner>();
 }