void Awake()
 {
     networkScript = GameObject.Find("Canvas").GetComponent <NetworkTest> ();
     if (Instance == null)
     {
         Instance = this;
     }
 }
        // Start is called before the first frame update
        void Start()
        {
            network = FindObjectOfType <NetworkTest>();

            network.OnInRoom
            .TakeUntilDestroy(this)
            .Subscribe(_ =>
            {
                Debug.Log("にゅーしゅつ!処理できます");
            });

            this.UpdateAsObservable()
            .TakeUntilDestroy(this)
            .Where(_ => network.IsInRoom.Value)
            .Subscribe(_ =>
            {
                if (OVRInput.GetDown(OVRInput.RawButton.A) || Input.GetMouseButtonDown(0))
                {
                    text.text = "Aボタン";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.B) || Input.GetMouseButtonDown(1))
                {
                    text.text = "Bボタン";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.X))
                {
                    text.text = "Xボタン";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.Y))
                {
                    text.text = "Yボタン";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.Start))
                {
                    text.text = "メニューボタン";
                }

                if (OVRInput.GetDown(OVRInput.RawButton.RIndexTrigger))
                {
                    text.text = "右人差し指トリガー";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.RHandTrigger))
                {
                    text.text = "右中指トリガー";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.LIndexTrigger))
                {
                    text.text = "左人差し指トリガー";
                }
                if (OVRInput.GetDown(OVRInput.RawButton.LHandTrigger))
                {
                    text.text = "左中指トリガー";
                }
            });
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataService dataService)
        {
            _dataService = dataService;
            _dataService.GetData(
                (item, error) =>
            {
                if (error != null)
                {
                    // Report error here
                    return;
                }

                WelcomeTitle = item.Title;
            });
            NetworkTest.Test();
        }
    void Start()
    {
        var test = new NetworkTest();

        test.Start();
    }
Exemple #5
0
 void Awake()
 {
     instance = this;
     UIEventListener.Get(BtnLogin_).onClick = OnLoginGame;
 }
 void Awake()
 {
     instance = this;
 }