Exemple #1
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (Application.isPlaying)
            {
                return;
            }

            if (GUI.changed)
            {
                AnchorSyncer.Sync(targetAnchor);
            }
        }
Exemple #2
0
        /// <summary>
        /// Creates a new anchor object
        /// </summary>
        private void AddAnchor()
        {
            GameObject anchorGo = new GameObject("anchor", typeof(Anchor));
            Anchor     anchor   = anchorGo.GetComponent <Anchor>();

            AnchorSyncer.Sync(anchor);

            anchorGo.transform.SetParent(AnchorsContainer);
            anchorGo.transform.localPosition = Vector3.zero;

            GameObject spawnedVisualisation = PrefabUtility.InstantiatePrefab(t.AnchorVisualisation) as GameObject;

            spawnedVisualisation.transform.SetParent(anchorGo.transform);
            spawnedVisualisation.transform.localPosition = Vector3.zero;
        }