本文整理汇总了C#中MainMenu.Pointed方法的典型用法代码示例。如果您正苦于以下问题:C# MainMenu.Pointed方法的具体用法?C# MainMenu.Pointed怎么用?C# MainMenu.Pointed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu.Pointed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RayPoint
void RayPoint()
{
if(hit.collider != null)
{
target.transform.position = hit.transform.position;
if(hit.collider.gameObject.tag == "Button")
{
pointed = hit.collider.gameObject.GetComponent<Button>();
if(pointed != null)
{
pointed.Pointed();
}
}
else if(hit.collider.gameObject.tag == "MainMenu")
{
MainMenu_pointed = hit.collider.gameObject.GetComponent<MainMenu>();
if(MainMenu_pointed != null)
{
// TODO : Mouse Enter (HJOOn)
MainMenu_pointed.Pointed();
}
}
else if (hit.collider.gameObject.tag == "Information") //Information 버튼 구현(add Jin)
{
Information_pointed = hit.collider.gameObject.GetComponent<Information>();
if (Information_pointed != null)
{
Information_pointed.Pointed();
}
}
else if (hit.collider.gameObject.tag == "InformationButton") //Information 버튼 구현(add Jin)
{
InformationButton_pointed = hit.collider.gameObject.GetComponent<InformationButton>();
if (InformationButton_pointed != null)
{
InformationButton_pointed.Pointed();
}
}
else if (hit.collider.gameObject.tag == "InformationCanvas") //Information 버튼 구현(add Jin)
{
InfoCanvas_pointed = hit.collider.gameObject.GetComponent<InformationCanvas>();
if (InfoCanvas_pointed != null)
{
InfoCanvas_pointed.Pointed();
}
}
}
}
示例2: Update
// Update is called once per frame
void Update()
{
Frame frame = controller.Frame(); //frame
GestureList gestures = frame.Gestures(); //frame 안의 gesture 인식
HandList hands = frame.Hands; //frame 안의 hands 인식
int num_hands = hands.Count; //hand의 수
if (num_hands < 1) // 인식된 손이 없다면
{
return;
}
else
{
Hand left = hands.Leftmost; //왼쪽손
Hand right = hands.Rightmost; //오른쪽 손
FingerList fingerList = left.Fingers; //왼쪽 손의 손가락들!
Finger leftFinger = fingerList.Frontmost; //왼손에서 제일 앞에 있는 손가락
rigid = GameObject.Find("RigidHand(Clone)");
if (rigid == null)
{
Debug.LogWarning("RigidHand is null");
return;
}
cursorPointer = GameObject.Find("RigidHand(Clone)/index/bone3");
if (cursorPointer == null)
{
Debug.LogWarning("CursorPointer is null");
return;
}
//여기에서 립모션 손모양 오븥젝트의 Collision 을 해체하여 Raycast에 충돌 하지 않게 한다.
Collider[] cols = rigid.GetComponentsInChildren<Collider>();
for (int i = 0; i < cols.Length; i++)
{
cols[i].enabled = false;
}
GameObject handController = GameObject.Find("HandController"); //HandCOnroller 오브젝트 접근
//팁핑 포지션으로 커서를 이동
if (rigid != null)
{
//Debug.Log ("Rigid finded");
Vector3 temp = Tipping();
cursorModel.transform.position = temp;
}
//손바닥을 UnityScale로 좌표 변환 , Handcontroller TransformPoint로 Transform 형식에 맞게 변환, 이후 왼쪽 카메라 기준으로 월드 스크린으로 변환
//Vector2 screenPoint=leftCamera.camera.WorldToScreenPoint (handController.transform.TransformPoint(left.PalmPosition.ToUnityScaled()));
Vector2 screenPoint = leftCamera.camera.WorldToScreenPoint(cursorPointer.transform.position);
Ray r = leftCamera.camera.ScreenPointToRay(screenPoint); // ScreentPoint로부터 Ray를 쏜다
Debug.DrawRay(r.origin, r.direction * 1000, Color.red);
RaycastHit hit; //rayCast에서 부딛힌 객체 관리
if (Physics.Raycast(r, out hit, Mathf.Infinity))
{
//Debug.Log("hit - ObjName : " + hit.collider.name +
// ", Flag - " +hit.collider.gameObject.tag );
if(hit.collider != null)
{
target.transform.position = hit.transform.position;
if(hit.collider.gameObject.tag == "Button")
{
pointed = hit.collider.gameObject.GetComponent<Button>();
if(pointed != null)
{
pointed.Pointed();
}
}
else if(hit.collider.gameObject.tag == "MainMenu")
{
MainMenu_pointed = hit.collider.gameObject.GetComponent<MainMenu>();
if(MainMenu_pointed != null)
{
// TODO : Mouse Enter (HJOOn)
MainMenu_pointed.Pointed();
}
}
else if (hit.collider.gameObject.tag == "Information") //Information 버튼 구현(add Jin)
{
Information_pointed = hit.collider.gameObject.GetComponent<Information>();
if (Information_pointed != null)
{
Information_pointed.Pointed();
}
}
}
}
else
{
// TODO : Mouse Exit (SHJO)
if(pointed != null)
{
//hit.collider.gameObject.renderer.material.color=Color.red;
pointed.PointedOut();
pointed=null;
//.........这里部分代码省略.........