Exemplo n.º 1
0
        public override void OnSCLateUpdate()
        {
            base.OnSCLateUpdate();

            if (touchPointer.IsFocusLocked || grabPointer.IsFocusLocked || farPointer.IsFocusLocked)
            {
            }
            else
            {
                if (touchPointer.FindClosestTouchableForLayerMask())
                {
                    if (touchPointer.IsModuleStarted == false)
                    {
                        touchPointer.ModuleStart();
                        handPointer = touchPointer;
                    }
                    if (grabPointer.IsModuleStarted)
                    {
                        grabPointer.ModuleStop();
                    }
                    if (farPointer.IsModuleStarted)
                    {
                        farPointer.ModuleStop();
                    }
                }
                else if (grabPointer.FindClosestGrabbableForLayerMask())
                {
                    if (touchPointer.IsModuleStarted)
                    {
                        touchPointer.ModuleStop();
                    }
                    if (grabPointer.IsModuleStarted == false)
                    {
                        grabPointer.ModuleStart();
                        handPointer = grabPointer;
                    }
                    if (farPointer.IsModuleStarted)
                    {
                        farPointer.ModuleStop();
                    }
                }
                else
                {
                    if (touchPointer.IsModuleStarted)
                    {
                        touchPointer.ModuleStop();
                    }
                    if (grabPointer.IsModuleStarted)
                    {
                        grabPointer.ModuleStop();
                    }
                    if (farPointer.IsModuleStarted == false)
                    {
                        farPointer.ModuleStart();
                        handPointer = farPointer;
                    }
                }
            }
            currentPointer = handPointer;
        }
Exemplo n.º 2
0
    void Start()
    {
        liftPointer = this.transform.GetChild(0).GetComponent <PointerBase>();
        dragPointer = this.transform.GetChild(1).GetComponent <PointerBase>();

        liftPointer.SetUnit("N");
        dragPointer.SetUnit("N");

        rigidBody           = mainObject.GetComponent <Rigidbody>();
        mainObjectTransform = mainObject.GetComponent <Transform>();
        velocity            = rigidBody.velocity;

        wingCollider      = wingTransform.GetComponent <BoxCollider>();
        wingInitialBounds = wingTransform.GetComponent <Collider>().bounds;
        wingCurrentBounds = wingInitialBounds;
    }