Beispiel #1
0
 private void Initialize()
 {
     myReceiver = GetComponent <JoyStickReceiver>();
     foreach (JoyStickForwarder jsf in GetComponentsInChildren <JoyStickForwarder>())
     {
         jsf.Destination = myReceiver;
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        // 子オブジェクトの取得
        _child = transform.FindChild("humer").gameObject;

        jsr = new JoyStickReceiver();
        kcs = new KeyConfigSettings();
        kcs.Init();
    }
Beispiel #3
0
 public void SetDestination(JoyStickReceiver receiver)
 {
     if (destination != null)
     {
         GetComponent <JoyStickReceiver>().JoyStickTouched -= destination.ReceiverJoystickInput;
     }
     destination = receiver;
     GetComponent <JoyStickReceiver>().JoyStickTouched += destination.ReceiverJoystickInput;
 }
    public void Initialize()
    {
        if (!initialized)
        {
            joystickReceiver = GetComponent <JoyStickReceiver>();
            distributionText = transform.parent.Find("Text").GetComponent <TMPro.TextMeshPro>();

            initialized = true;
        }
    }
Beispiel #5
0
 protected void Start()
 {
     roundBy    = 90; //divides into four quadrants
     menu       = GetComponent <SaveLoadMenu>();
     jsReceiver = GetComponent <JoyStickReceiver>();
     if (jsReceiver != null)
     {
         jsReceiver.JoyStickTouched += scroll;
     }
 }
Beispiel #6
0
    void SendJoyStickInput(VRController c, ControllerComponentArgs e)
    {
        if (!sender.CurrTargetData.hitting)
        {
            return;
        }
        JoyStickReceiver receiver = sender.CurrTargetData.target.GetComponent <JoyStickReceiver>();

        if (receiver != null)
        {
            receiver.ReceiverJoystickInput(c, e);
        }
    }
Beispiel #7
0
    // 初期化
    public void Init()
    {
        try
        {
            FilePath = Application.dataPath + "/Scenes/hayase/" + Application.unityVersion + ".txt";
            jsr      = new JoyStickReceiver();

            // ファイルからキー状態の設定を読み込む
            FileStream   fs = new FileStream(FilePath, FileMode.OpenOrCreate);
            StreamReader sr = new StreamReader(fs);
            ArrayList    ar = new ArrayList();
            string       s;
            while ((s = sr.ReadLine()) != null)
            {
                Debug.Log(s);
                ar.Add(s);
            }

            sr.Close();
            fs.Close();
            if (ar.Count == 0)
            {
                Debug.Log("とりま");
                // ファイルが有っても中身が無いときのとりあえず入れとくやつ
                KeyConfig.Config["Jump"] = jsr.GetPlayBtn(JoyStickReceiver.PlayStationContoller.Cross);
                KeyConfig.Config["Zone"] = jsr.GetPlayBtn(JoyStickReceiver.PlayStationContoller.L1);
            }
            else
            {
                Debug.Log("あるやん");
                // 設定する
                KeyConfig.Config["Jump"] = ar[0].ToString();
                KeyConfig.Config["Zone"] = ar[1].ToString();
                mo = int.Parse(ar[2].ToString());
            }
        }
        catch (IOException e)
        {
            Debug.Log(e.Message + "エラー");
            // エラー出たらとりあえず入れる
            KeyConfig.Config["Jump"] = jsr.GetPlayBtn(JoyStickReceiver.PlayStationContoller.Cross);
            KeyConfig.Config["Zone"] = jsr.GetPlayBtn(JoyStickReceiver.PlayStationContoller.L1);
        }

        KeyConfig.Config["Submit"] = jsr.GetPlayBtn(JoyStick_Submit);
        SetDisp("JumpBtn", KeyConfig.Config["Jump"]);
        SetDisp("ZoneBtn", KeyConfig.Config["Zone"]);
    }
Beispiel #8
0
    void Start()
    {
        if (transform.localEulerAngles != Vector3.zero)
        {
            Debug.LogError("Local rotation of object with Scroll script needs to be zero");
            UnityEditor.EditorApplication.isPlaying = false;
        }

        if (objectParent.localScale != Vector3.one || objectParent.localEulerAngles != Vector3.zero)
        {
            Debug.LogError("Local scale and local rotation of Object Parent needs to be one and zero");
            UnityEditor.EditorApplication.isPlaying = false;
        }

        jsReceiver = GetComponent <JoyStickReceiver>();
        if (jsReceiver != null)
        {
            jsReceiver.JoyStickTouched += scroll;
        }
    }