Exemplo n.º 1
0
 private void TryStopPlacing(bool flagForce = false)
 {
     if (flagForce)
     {
         this.placeables = FindObjectsOfType <Interactible_Placeable>();
         foreach (Interactible_Placeable placeable in this.placeables)
         {
             placeable.OnTrySnap();
         }
         this.activePlaceable = null;
     }
     else if (this.activePlaceable != null)
     {
         if (this.activePlaceable.OnTrySnap())
         {
             this.activePlaceable = null;
         }
     }
 }
Exemplo n.º 2
0
 // Extract information about cursor hit info.
 private void ExtractClickInfo()
 {
     // If clicked on scanned mesh - stop placment
     if ((this.activePlaceable != null) && (this.flagHitGaze && ObjectManager.instance.CheckEnvironmentObject(this.hitGaze.transform.gameObject)))
     {
                         #if DEBUG
         Debug.Log("Interaction Manager: Click On Scan Mesh");
                         #endif
         TryStopPlacing();
     }
     else
     {
         // Find interactibles if any.
         if (this.flagHitGaze)
         {
             this.activePlaceable = CheckPlaceableHit(this.hitGaze.transform.gameObject);
         }
         if (this.flagHitSelect)
         {
             this.activeMovable = CheckMovableHit(this.hitSelect.transform.gameObject);
         }
     }
 }
Exemplo n.º 3
0
        void Start()
        {
            this.flagOpen = false;
            foreach (Transform child in transform)
            {
                if (child.name == "z")
                {
                    this.zAxis = child.gameObject;
                }
                if (child.name == "y")
                {
                    this.yAxis = child.gameObject;
                }
                if (child.name == "x")
                {
                    this.xAxis = child.gameObject;
                }
                if (child.tag == "Point3DPlaneXY")
                {
                    this.xyPlane = child.gameObject;
                }
                if (child.tag == "Point3DToggle")
                {
                    this.trigger = child.gameObject;
                }
            }
            this.zAnim       = this.zAxis.GetComponent <Animator>();
            this.yAnim       = this.yAxis.GetComponent <Animator>();
            this.xAnim       = this.xAxis.GetComponent <Animator>();
            this.triggerAnim = this.trigger.GetComponent <Animator>();

            this.placeable = gameObject.GetComponent <Interactible_Placeable>();
            // this.placeable.flagPlacingOnStart = true;
            this.placeable.OnStartPlacing = ToggleState;
            this.placeable.OnEndPlacing   = ToggleState;
        }