Пример #1
0
 private void On_BAnchor_BAnchorRayHoverExit(BAnchor bAnchor)
 {
     if (boundingBox)
     {
         boundingBox.SetActive(false);
     }
 }
Пример #2
0
        private void On_BAnchor_BAnchorRaySelected(BAnchor bAnchor)
        {
            if (CanPlaceBAnchor == true &&
                IS_NOT_NULL(ARCursor.Instance))
            {
                bool succeeded = false;
                if (IsPlacing == false)
                {
                    succeeded = ARManager.Instance.OnStartPlacingBAnchor(this, bAnchor);
                }
                else
                {
                    succeeded = ARManager.Instance.OnStopPlacingBAnchor(this, bAnchor);
                }

                if (succeeded == true)
                {
                    if (IsPlacing == false)
                    {
                        IsPlacing = true;
                        InvokeEventIfBound(StartedPlacing, bAnchor);
                    }
                    else
                    {
                        IsPlacing = false;
                        InvokeEventIfBound(EndedPlacing, bAnchor);
                    }
                }
            }
        }
Пример #3
0
 private void On_BAnchor_BAnchorRayHoverEnter(BAnchor bAnchor)
 {
     if (boundingBox)
     {
         boundingBox.SetActive(true);
     }
 }
Пример #4
0
        public void SpawnTestBAnchor()
        {
            BAnchor testBAnchorPrefab = Resources.Load <BAnchor>(BConsts.PATH_AR_TestBAnchor);

            if (IS_NOT_NULL(testBAnchorPrefab))
            {
                ARManager.Instance.SpawnBAnchorAtCursorPosition(testBAnchorPrefab, true);
            }
        }
Пример #5
0
        private void On_BAnchorCursorPlacer_EndedPlacing(BAnchor bAnchor)
        {
            PlayAreaBAnchor playAreaBAnchor = (PlayAreaBAnchor)bAnchor;

            if (IS_NOT_NULL(playAreaBAnchor) &&
                (ARE_EQUAL(playAreaBAnchor, this)))
            {
                InvokeEventIfBound(EndedPlacing, this);
            }
        }
Пример #6
0
        protected override void OnValidate()
        {
            base.OnValidate();

            if (CanValidate() == false)
            {
                return;
            }

            if (bAnchor == null)
            {
                bAnchor = GetComponentInHierarchy <BAnchor>();
            }
        }
Пример #7
0
        private void On_CameraRayCaster_OnRayCastableExit(IRayCastable rayCastable)
        {
            BAnchor bAnchor = (BAnchor)rayCastable;

            if (bAnchor &&
                bAnchor == raycastedBAnchor)
            {
                raycastedBAnchor = null;
                if (IS_NOT_NULL(bButton))
                {
                    bButton.DisableButton();
                }
            }
        }
Пример #8
0
        private void On_CameraRayCaster_OnRayCastableEnter(IRayCastable rayCastable)
        {
            BAnchor bAnchor = (BAnchor)rayCastable;

            if (bAnchor)
            {
                raycastedBAnchor = bAnchor;

                if (IS_NOT_NULL(bButton))
                {
                    bButton.EnableButton();
                }
            }
        }
Пример #9
0
        protected override void Awake()
        {
            base.Awake();

            // Initialize Banchor Collection Map
            foreach (BAnchorCollectionTupple bAnchorCollectionTupple in bAnchorCollectionTupples)
            {
                string  bAnchorID     = bAnchorCollectionTupple.BAnchorID;
                BAnchor bAnchorPrefab = bAnchorCollectionTupple.BAnchorPrefab;
                if (IS_KEY_NOT_CONTAINED(bAnchorCollectionMap, bAnchorID) &&
                    IS_NOT_NULL(bAnchorPrefab))
                {
                    bAnchorCollectionMap.Add(bAnchorID, bAnchorPrefab);
                }
            }
        }
Пример #10
0
        //private float lastTimeReplicated;

        #endregion

        #region Life Cycle
        protected override void OnValidate()
        {
            base.OnValidate();

            if (CanValidate())
            {
                if (bAnchor == null)
                {
                    bAnchor = GetComponentInHierarchy <BAnchor>();
                }

                if (bAnchor != null)
                {
                    bAnchorID = bAnchor.BAnchorID;
                }
            }
        }
Пример #11
0
        protected override void OnValidate()
        {
            base.OnValidate();

            if (CanValidate() == false)
            {
                return;
            }

            if (bAnchor == null)
            {
                bAnchor = GetComponent <BAnchor>();
            }
            if (debugText == null)
            {
                debugText = GetComponent <BText>();
            }
        }
Пример #12
0
 public BAnchorCollectionTupple(string bAnchorID, BAnchor bAnchorPrefab)
 {
     BAnchorID     = bAnchorID;
     BAnchorPrefab = bAnchorPrefab;
 }