| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- /// <summary>
- /// ZWN
- /// 20210915
- /// </summary>
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class raise_hand : MonoBehaviour
- {
- public int num_virus;//关于病毒是否播放开场视频
- public static raise_hand single;
- void Awake()
- {
- single = this;
- }
- Vector3 Rightwrist = Vector3.zero;
- Vector3 Rightelbow = Vector3.zero;
- Vector3 Leftwrist = Vector3.zero;
- Vector3 Leftelbow = Vector3.zero;
- Vector3 default_vec = new Vector3(-1, -1, 0);
- public bool Raise_Hand()
- {
- Rightwrist = Vector3.zero;
- Rightelbow = Vector3.zero;
- Leftwrist = Vector3.zero;
- Leftelbow = Vector3.zero;
- if (zwn_common_data.single.zwn_original_pose.Length >= 17)//是否存在整个人
- {
- //右腕
- if (zwn_common_data.single.zwn_original_pose[10] != default_vec)
- {
- Rightwrist = zwn_common_data.single.zwn_original_pose[10];
- }
- //右眼
- if (zwn_common_data.single.zwn_original_pose[2] != default_vec)
- {
- Rightelbow = zwn_common_data.single.zwn_original_pose[2];
- }
- //左腕
- if (zwn_common_data.single.zwn_original_pose[9] != default_vec)
- {
- Leftwrist = zwn_common_data.single.zwn_original_pose[9];
- }
- //左眼
- if (zwn_common_data.single.zwn_original_pose[1] != default_vec)
- {
- Leftelbow = zwn_common_data.single.zwn_original_pose[1];
- }
- if (Rightwrist.y == 0 || Rightelbow.y == 0
- || Leftwrist.y == 0 || Leftelbow.y == 0)
- {
- return false;
- }
- if (Rightwrist.y < Rightelbow.y)
- {
- return true;
- }
- else if (Leftwrist.y < Leftelbow.y)
- {
- return true;
- }
- return false;
- }
- return false;
- }
- /// <summary>
- /// 举右手
- /// </summary>
- /// <returns></returns>
- public bool Raise_RightHand()
- {
- Rightwrist = Vector3.zero;
- Rightelbow = Vector3.zero;
- if (zwn_common_data.single.zwn_original_pose.Length >= 17)//是否存在整个人
- {
- //右腕
- if (zwn_common_data.single.zwn_original_pose[10] != default_vec)
- {
- Rightwrist = zwn_common_data.single.zwn_original_pose[10];
- }
- //右眼
- if (zwn_common_data.single.zwn_original_pose[2] != default_vec)
- {
- Rightelbow = zwn_common_data.single.zwn_original_pose[2];
- }
- if (Rightwrist.y == 0 || Rightelbow.y == 0)
- {
- return false;
- }
- if (Rightwrist.y < Rightelbow.y)
- {
- return true;
- }
- return false;
- }
- return false;
- }
- /// <summary>
- /// 举左手
- /// </summary>
- /// <returns></returns>
- public bool Raise_LeftHand()
- {
- Leftwrist = Vector3.zero;
- Leftelbow = Vector3.zero;
- if (zwn_common_data.single.zwn_original_pose.Length >= 17)//是否存在整个人
- {
- //左腕
- if (zwn_common_data.single.zwn_original_pose[9] != default_vec)
- {
- Leftwrist = zwn_common_data.single.zwn_original_pose[9];
- }
- //左眼
- if (zwn_common_data.single.zwn_original_pose[1] != default_vec)
- {
- Leftelbow = zwn_common_data.single.zwn_original_pose[1];
- }
- if (Leftwrist.y == 0 || Leftelbow.y == 0)
- {
- return false;
- }
- if (Leftwrist.y < Leftelbow.y)
- {
- return true;
- }
- return false;
- }
- return false;
- }
- }
|