示例#1
0
 // Update is called once per frame
 void Update()
 {
     pos   = InputManager_JHW.SubJoystick();
     pos.y = -pos.x;
     pos.x = 0.0f;
     pos.z = 0.0f;
     transform.Rotate(pos);
 }
示例#2
0
    private IEnumerator targetChange()
    {
        Vector3 Stick;
        int     index = 5;

        while (true)
        {
            Stick = InputManager_JHW.SubJoystick();
            if (Stick.x < 0)
            {
                index = 0;
            }
            else if (Stick.x > 0)
            {
                index = 1;
            }
            Vector3 RorL = Vector3.zero;
            if (index != 5)
            {
                SortTargetList();
                for (int i = 0; i < TargetCount; ++i)
                {
                    if (TargetMonster[i].gameObject != Mytarget.gameObject)
                    {
                        RorL = transform.InverseTransformPoint(TargetMonster[i].transform.position);
                    }
                    if (index == 0)
                    {
                        if (RorL.x < 0f)
                        {
                            Mytarget = TargetMonster[i];
                            break;
                        }
                    }
                    else if (index == 1)
                    {
                        if (RorL.x > 0f)
                        {
                            Mytarget = TargetMonster[i];
                            break;
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(0.5f));

            index = 5;
        }
    }