Example #1
0
 /*
  * セーブデータを読み込む
  */
 public static void Load(GameObject parent)
 {
     if (PlayerPrefs.HasKey("mappedPosList"))
     {
         Vector3[] posList = PlayerPrefsX.GetVector3Array("mappedPosList");
         for (int i = 0; i < posList.Length; i++)
         {
             FingerMapper.MarkPoint(parent, posList[i]);
         }
         Debug.Log("Loaded mappedPosList");
     }
 }
Example #2
0
    void Update()
    {
        Frame frame = this.m_Provider.CurrentFrame;

        Hand[] hands = HandUtil.GetCorrectHands(frame); //0=LEFT, 1=RIGHT
        if (hands[HandUtil.LEFT] != null && hands[HandUtil.RIGHT] != null)
        {
            Hand leftHand  = hands[HandUtil.LEFT];
            Hand rightHand = hands[HandUtil.RIGHT];
            if (this.handUtil.JustOpenedHandOn(hands, HandUtil.LEFT))
            {
                //Moment that index finger of left hand is opened
                if (rightHand.Fingers[(int)FingerType.TYPE_INDEX].IsExtended)
                {
                    Vector3 markingPoint = HandUtil.ToVector3(rightHand.Fingers[(int)FingerType.TYPE_INDEX].TipPosition);
                }
            }
            else if (this.handUtil.JustOpenedHandOn(hands, HandUtil.RIGHT))
            {
                //Moment that index finger of right hand is opened
                if (leftHand.Fingers[(int)FingerType.TYPE_INDEX].IsExtended)
                {
                    Vector3 markingPoint = HandUtil.ToVector3(leftHand.Fingers[(int)FingerType.TYPE_INDEX].TipPosition);
                    FingerMapper.MarkPoint(this.mappedPoints, markingPoint);
                    Debug.Log("Marked point at " + markingPoint);
                }
            }
        }

        if (SceneManager.GetActiveScene().name == FingerMapper.sceneName)
        {
            if (Input.GetKeyUp(KeyCode.E))
            {
                this.Save();
            }
            else if (Input.GetKeyUp(KeyCode.D))
            {
                //foreach (Transform t in this.mappedPoints.transform) { Destroy(t.gameObject); }
            }
        }

        //this.handUtil.SavePreviousFingers(hands);
        this.handUtil.SavePreviousHands(hands);
    }
Example #3
0
    void Start()
    {
        this.m_Provider = this.leapProviderObj.GetComponent <LeapServiceProvider>();
        this.handUtil   = new HandUtil(player);
        FingerMapper.Load(this.mappedPoints);

        this.isStartedLighting = false;
        this.inactivePoints    = new List <Vector3>();
        foreach (Transform point in mappedPoints.transform)
        {
            this.inactivePoints.Add(point.position);
        }

        //線を描画する処理に使う
        this.line = new Line()
        {
            currentPoint = Vector3.zero, nextPoint = Vector3.zero, progress = 0.0f,
            drawingSpeed = LINE_DRAWING_SPEED
        };
        this.lineTimer   = new Util.Timer(2.5f);
        this.light3Timer = new Util.Timer(6.0f);
    }
Example #4
0
 void Start()
 {
     this.m_Provider = this.leapProviderObj.GetComponent <LeapServiceProvider>();
     this.handUtil   = new HandUtil(player);
     FingerMapper.Load(this.mappedPoints);
 }