コード例 #1
0
 void Awake()
 {
     if (mToggle == null) mToggle = GetComponent<UIToggle>();
     if (mToggleObjects == null) mToggleObjects = GetComponent<UIToggledObjects>();
     if (mPlaySound == null) mPlaySound = GetComponent<UIPlaySound>();
     if (mBtnActivate == null) mBtnActivate = GetComponent<UIButtonActivate>();
 }
コード例 #2
0
 static public int get_target(IntPtr l)
 {
     try {
         UIButtonActivate self = (UIButtonActivate)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.target);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #3
0
 static public int set_state(IntPtr l)
 {
     try {
         UIButtonActivate self = (UIButtonActivate)checkSelf(l);
         System.Boolean   v;
         checkType(l, 2, out v);
         self.state = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #4
0
 static public int set_target(IntPtr l)
 {
     try {
         UIButtonActivate       self = (UIButtonActivate)checkSelf(l);
         UnityEngine.GameObject v;
         checkType(l, 2, out v);
         self.target = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #5
0
ファイル: mainKinect.cs プロジェクト: gun2841/guno
    // Update is called once per frame
    void Update()
    {
        //키넥트 초기화
        #region kinect initialize
        if (player == -1)
        {
            return;
        }
        if (sw.pollSkeleton())
        {
            for (int ii = 0; ii < (int)Kinect.NuiSkeletonPositionIndex.Count; ii++)
            {
                //_bonePos[ii] = sw.getBonePos(ii);
                if (((uint)Mask & (uint)(1 << ii)) > 0)
                {
                    //_bones[ii].transform.localPosition = sw.bonePos[player,ii];
                    _boneposition[ii] = new Vector3(
                        sw.bonePos[player, ii].x * scale,
                        sw.bonePos[player, ii].y * scale,
                        sw.bonePos[player, ii].z * scale);
                }
            }
        }
        int hipcenter = (int)Kinect.NuiSkeletonPositionIndex.HipCenter;      // 엉덩이
        int shoulder  = (int)Kinect.NuiSkeletonPositionIndex.ShoulderCenter; // 어ㄲㅐ
        int head      = (int)Kinect.NuiSkeletonPositionIndex.Head;           //머리
        int lefthand  = (int)Kinect.NuiSkeletonPositionIndex.HandLeft;
        int righthand = (int)Kinect.NuiSkeletonPositionIndex.HandRight;
        int leftfoot  = (int)Kinect.NuiSkeletonPositionIndex.FootLeft;
        int rightfoot = (int)Kinect.NuiSkeletonPositionIndex.FootRight;
        #endregion

        // 맵선택 부분 변경해야함 <왼손 점프 오른손>
        #region level choice
        if (_boneposition[righthand].y - _boneposition[shoulder].y > 0.4f && check == 2)
        {
            Debug.Log("1");
            Application.LoadLevel("MAP_D-1");
        }
        if (_boneposition[lefthand].y - _boneposition[shoulder].y > 0.4f && check == 2)
        {
            Debug.Log("3");
            Application.LoadLevel("MAP_D-3");
        }
        if (_boneposition[head].z - _boneposition[shoulder].z > 0.2f && check == 2)
        {
            Debug.Log("2");
            Application.LoadLevel("MAP_D-2");
        }
        if (_boneposition[righthand].y - _boneposition[shoulder].y > 0.4f && check == 3)
        {
            Debug.Log("1");
            Application.LoadLevel("MAP_F-1");
        }
        if (_boneposition[lefthand].y - _boneposition[shoulder].y > 0.2f && check == 3)
        {
            Debug.Log("3");
            Application.LoadLevel("MAP_F-3");
        }
        if (_boneposition[head].z - _boneposition[shoulder].z > 0.2f && check == 3)
        {
            Debug.Log("2");
            Application.LoadLevel("MAP_F-2");
        }

        #endregion level choice
        //

        if (check == 0 && (_boneposition[rightfoot].y > _boneposition[hipcenter].y - 0.3f)) // 오른발 들기
        {
            check  = 1;
            script = GameObject.Find("Start").GetComponent <UIButtonActivate>();
            script.OnClick();
            Debug.Log("start");
        } // 시작하는 부분
        else if ((check != 0) && (_boneposition[righthand].y - _boneposition[shoulder].y > 0.3f) && (
                     _boneposition[lefthand].y - _boneposition[shoulder].y > 0.3f))
        {
            check   = 0;
            script1 = GameObject.Find("Home_Button").GetComponent <Home_Button>();
            script1.OnClick();
            Debug.Log("처음 화면으로!");
        } // RETRY
        else if (_boneposition[lefthand].x - _boneposition[shoulder].x < -0.5f && check == 1)
        {
            Debug.Log("ddddddddddddd");
            check  = 2;
            script = GameObject.Find("Dungeon").GetComponent <UIButtonActivate>();
            script.OnClick();
        }
        else if (_boneposition[righthand].x - _boneposition[shoulder].x > 0.5f && check == 1)
        {
            Debug.Log("ffffffffffffffffffffffffffffffffffffff");
            check  = 3;
            script = GameObject.Find("Forest").GetComponent <UIButtonActivate>();
            script.OnClick();
        }// dddddddd fffffffffff 결정부분
    }