///
/// ZWN
/// 20210915
///
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;
}
///
/// 举右手
///
///
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;
}
///
/// 举左手
///
///
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;
}
}