Пример #1
0
 // Use this for initialization
 void Start()
 {
     Input = GetComponent <PlInput>();                    //InputだとunityのInputと混じってめんどそうなので適当に名前いじってください。
     //ConKindは初期状態ではNOTHINGにしてあるので変更する
     Input.ChangePlConkind(0, PlInput.ConKind.KEYBOARD1); //移動がwasd,回転が←、→、ホールドがスペース
     Input.ChangePlConkind(1, PlInput.ConKind.JOYCON);    //移動が矢印、zxで回転、ホールドがスペース
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     PI = GetComponent <PlInput>();
     Debug.Log("Game's Start");
     PI.ChangePlConkind(0, PlInput.ConKind.KEYBOARD1);
     PI.ChangePlConkind(1, PlInput.ConKind.KEYBOARD2);
     Debug.Log(PlInput.Player[0].ConKind);
     Debug.Log(PlInput.Player[1].ConKind);
 }
Пример #3
0
 // Use this for initialization
 void Awake()
 {
     In       = GetComponent <PlInput>();
     back     = GameObject.Find("/Canvas/Button back").GetComponent <Button>();
     reconect = GameObject.Find("/Canvas/Button reconect").GetComponent <Button>();
     enter    = GameObject.Find("/Canvas/Button enter").GetComponent <Button>();
     reconect.Select();
     AudioSource[] audioSources = GetComponents <AudioSource>();
     SE_Submit = audioSources[1];
     SE_Cancel = audioSources[0];
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     //input.ChangePlConkind(0, PlInput.ConKind.KEYBOARD2);
     // input.ChangePlConkind(1, PlInput.ConKind.KEYBOARD1);
     Debug.Log("Player[0].ConKind is " + PlInput.GetConKind(0));
     Debug.Log("Player[1].ConKind is " + PlInput.GetConKind(1));
     //入力方法の初期化
     //今はとりあえずConKind.KEYBOARD1で
     if (PlInput.GetConKind(0) == PlInput.ConKind.NOTHING)
     {
         input.ChangePlConkind(0, PlInput.ConKind.KEYBOARD1);//移動がwasd,回転がK、L、ホールドがスペース
         PlInput.Player[0].JoyConNum = -1;
     }
     if (PlInput.GetConKind(1) == PlInput.ConKind.NOTHING)
     {
         input.ChangePlConkind(1, PlInput.ConKind.KEYBOARD2);//移動がwasd,回転がK、L、ホールドがスペース
         PlInput.Player[1].JoyConNum = -1;
     }
 }
Пример #5
0
    public void Reconect2()
    {
        var ConImg = GameObject.Find("/Canvas/Panel2/ConImg2").GetComponent <Image>();

        if (PlInput.GetConKind(1) == PlInput.ConKind.NOTHING)
        {
            if (Input.GetKeyDown(KeyCode.L))
            {
                In.ChangePlConkind(1, PlInput.ConKind.KEYBOARD1);
                SE_Submit.PlayOneShot(SE_Submit.clip);
                ConImg.sprite = KeyBoard1;
            }
            if (Input.GetKeyDown(KeyCode.X))
            {
                In.ChangePlConkind(1, PlInput.ConKind.KEYBOARD2);
                SE_Submit.PlayOneShot(SE_Submit.clip);
                ConImg.sprite = KeyBoard2;
            }
            for (int i = 0; i < 4; i++)
            {
                if (GamePad.GetButtonDown(GamePad.Button.B, (GamePad.Index)i))
                {
                    In.ChangePlConkind(1, PlInput.ConKind.JOYCON);
                    SE_Submit.PlayOneShot(SE_Submit.clip);
                    PlInput.Player[1].JoyConNum = i;
                    ConImg.sprite = JoyCon;
                }
            }
        }
        else if (PlInput.GetConKind(1) != PlInput.ConKind.NOTHING)
        {
            In.ChangePlConkind(1, PlInput.ConKind.NOTHING);
            PlInput.Player[1].JoyConNum = -1;
            SE_Cancel.PlayOneShot(SE_Cancel.clip);
            ConImg.sprite = Nothing;
        }
        Debug.Log("Player[1].ConKind is " + PlInput.GetConKind(1));
    }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     pInput = GetComponent <PlInput>();
     Debug.Log("Debug start\n");
     //pInput.ChangePlConkind(0, PlInput.ConKind.JOYCON);
 }
Пример #7
0
 public void ShowConKind()
 {
     Debug.Log("Player[0].ConKind is " + PlInput.GetConKind(0));
     Debug.Log("Player[1].ConKind is " + PlInput.GetConKind(1));
 }