Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        GameObject   go               = GameObject.Find("LeapManager");
        LeapBehavior lb               = go.GetComponent <LeapBehavior>();
        float        fingerHeight     = lb.fingerHeight;
        float        prevFingerHeight = lb.prevFingerHeight;

//		Debug.Log(fingerHeight);

        if ((fingerHeight == 0) && (prevFingerHeight != 0))
        {
            oldHeight = newHeight;
            isScaling = false;
        }
        else if ((fingerHeight != 0) && (prevFingerHeight == 0))
        {
            isScaling = true;
        }

        //Debug.Log (mouseScreenPosition.y);
        if (isScaling)
        {
            newHeight = fingerHeight * scaleFactor;          //(mouseScreenPosition.y - initMouseScreenPos.y)*scaleFactor;
            this.transform.localScale = new Vector3(1, newHeight + oldHeight, 1);
        }
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     leapBehavior = leapController.GetComponent<LeapBehavior>();
     rb = GetComponent<Rigidbody>();
     //paddlePosition = Vector3(leapBehavior.handX, leapBehavior.handY, leapBehavior.handZ);
     if (Network.isClient)
         reverseXAxis = -1;
     else
         reverseXAxis = 1;
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     leapBehavior = leapController.GetComponent<LeapBehavior>();
     rb = GetComponent<Rigidbody>();
     //paddlePosition = Vector3(leapBehavior.handX, leapBehavior.handY, leapBehavior.handZ);
 }
Ejemplo n.º 4
0
    private BaseBehavior GetBehaviorEntity(BehaviorType bt)
    {
        if (!behaviorUnions.ContainsKey(bt))
        {
            BaseBehavior bbh = null;
            switch (bt)
            {
            case BehaviorType.BT_Idle:
                bbh = new IdleBehavior();
                break;

            case BehaviorType.BT_FourcesLocal:
                bbh = new FourcesLocalBehavior();
                break;

            case BehaviorType.BT_Torque:
                bbh = new TorqueBehavior();
                break;

            case BehaviorType.BT_ForwardCtlMove:
                bbh = new ForwardControlMoveBehavior();
                break;

            case BehaviorType.BT_WorldForceCtlMove:
                bbh = new WorldForceControlMoveBehavior();
                break;

            case BehaviorType.BT_4DOFForwardMove:
                bbh = new DOF4ForwardMoveBehavior();
                break;

            case BehaviorType.BT_6DOFForwardMove:
                bbh = new DOF6ForwardMoveBehavior();
                break;

            case BehaviorType.BT_StopRotate:
                bbh = new StopRotateBehavior();
                break;

            case BehaviorType.BT_StopMove:
                bbh = new StopMoveBehavior();
                break;

            case BehaviorType.BT_TurnToTarget:
                bbh = new TurnToTargetBehavior();
                break;

            case BehaviorType.BT_UpTurnToTarget:
                bbh = new UpTurnToTargetBehavior();
                break;

            case BehaviorType.BT_TurningMove:
                bbh = new TurningMoveBehavior();
                break;

            case BehaviorType.BT_StopThenMoveToTarget:
                bbh = new StopThenMoveToTargetBehavior();
                break;

            case BehaviorType.BT_SmoothMoveToTarget:
                bbh = new SmoothMoveToTargetBehavior();
                break;

            case BehaviorType.BT_SmoothMoveTargets:
                bbh = new SmoothMoveTargetsBehavior();
                break;

            case BehaviorType.BT_Leap:
                bbh = new LeapBehavior();
                break;

            case BehaviorType.BT_LeapBreak:
                bbh = new LeapBreakBehavior();
                break;

            case BehaviorType.BT_BindMove:
                bbh = new BindMoveBehavior();
                break;

            case BehaviorType.BT_Slied:
                bbh = new SliedBehavior();
                break;

            default:
                bbh = new IdleBehavior();
                break;
            }
            behaviorUnions.Add(bt, bbh);
        }

        return(behaviorUnions[bt]);
    }