コード例 #1
0
ファイル: PlaySpeaker.cs プロジェクト: yanghyunjin/IoTAR
    void Start()
    {
        Application.LoadLevelAdditive ("IoTAR1");
        Debug.Log ("PlaySpeaker Start()");
        repeatGet = Vuforia.TrackerManager.Instance.GetStateManager ();
        android = AndroidPluginManager.GetInstance ();
        // android.CallAndroid_Speaker_Get ();
        playButton = GameObject.Find ("PlayButton");
        pauseButton = GameObject.Find ("PauseButton");
        preButton = GameObject.Find ("PreButton");
        nextButton = GameObject.Find ("NextButton");
        song = GameObject.Find ("Song");
        lyrics = GameObject.Find ("Lyrics");
        volume = GameObject.Find ("Volume");
        canvas = GameObject.Find ("SongListCanvas");
        songItem = GameObject.Find ("GridOfList").GetComponentsInChildren<Button> ();
        List = false;
        for (int i=0; i<20; ++i) {
            AddListener((Button)songItem.GetValue (i), ((Button)songItem.GetValue (i)).name.Substring(4));
        }

        songTextMesh = (TextMesh)song.GetComponent (typeof(TextMesh));
        lyricsTextMesh = (TextMesh)lyrics.GetComponent (typeof(TextMesh));

        playButton.SetActive (true);
        pauseButton.SetActive (false);
        volumeItem = volume.GetComponentsInChildren<Renderer> (); // volume item (100개)
        volume.SetActive (false);
        android.CallAndroid_Speaker_Get();
        getTime = Time.time;
    }
コード例 #2
0
    void Awake()
    {
        linkCount = 0;
        //		cameraButton = GameObject.Find ("CameraButton").GetComponent<Button> ();           //카메라 버튼
        //		cameraButton.onClick.AddListener (delegate{StartCoroutine(CameraButtonFunction());});   //카메라 버튼 리스너

        memorySceneButton0 = GameObject.Find ("ScreenshotPanel0").GetComponent<Button> ();
        memorySceneButton1 = GameObject.Find ("ScreenshotPanel1").GetComponent<Button> ();   //panel 에 버튼 컴포넌트 추가해야 동작함.
        memorySceneButton2 = GameObject.Find ("ScreenshotPanel2").GetComponent<Button> ();
        memorySceneButton3 = GameObject.Find ("ScreenshotPanel3").GetComponent<Button> ();
        memorySceneButton4 = GameObject.Find ("ScreenshotPanel4").GetComponent<Button> ();

        memorySceneImage0 = GameObject.Find ("ScreenshotPanel0").GetComponent<Image> ();
        memorySceneImage1 = GameObject.Find ("ScreenshotPanel1").GetComponent<Image> ();   //panel 에 이미지 컴포넌트 추가해야 세팅됨.
        memorySceneImage2 = GameObject.Find ("ScreenshotPanel2").GetComponent<Image> ();
        memorySceneImage3 = GameObject.Find ("ScreenshotPanel3").GetComponent<Image> ();
        memorySceneImage4 = GameObject.Find ("ScreenshotPanel4").GetComponent<Image> ();

        memorySceneButton0.onClick.AddListener (delegate { ChangeScene(0);});  //1, 2, 3 다 추가 해야 함
        memorySceneButton1.onClick.AddListener (delegate { ChangeScene(1);});  //1, 2, 3 다 추가 해야 함
        memorySceneButton2.onClick.AddListener (delegate { ChangeScene(2);});  //1, 2, 3 다 추가 해야 함
        memorySceneButton3.onClick.AddListener (delegate { ChangeScene(3);});  //1, 2, 3 다 추가 해야 함
        memorySceneButton4.onClick.AddListener (delegate { ChangeScene(4);});  //1, 2, 3 다 추가 해야 함

        canvasTarget = GameObject.Find ("CanvasTarget");   //타겟들을 하나의 캔버스에 다 넣고 캔버스를 없애면 차일드도 다 사라지는듯
        memoryCanvas = GameObject.Find ("MemoryCanvas");

        state = Vuforia.TrackerManager.Instance.GetStateManager ();  // whatObject 함수에서 필요함.

        if (memoryclass == null) {                          // 초기 부팅시 할것들 .
            memoryclass = new memoryClass[5];
        }

        if (memorySprite == null) {
            memorySprite = new Sprite[5];
        }

        setMemoryImage (); // 화면 상단에 이미지 세팅하는 함수;

        Hue1 = GameObject.Find ("ImageTarget1");  // 현재는 구지만 파레트나 mp3 도어락 같은거 해야함.
        Hue2 = GameObject.Find ("ImageTarget2");  // 현재는 구지만 파레트나 mp3 도어락 같은거 해야함.
        Hue3 = GameObject.Find ("ImageTarget3");  // 현재는 구지만 파레트나 mp3 도어락 같은거 해야함.
        Speaker = GameObject.Find ("ObjectTarget");
        Doorlock = GameObject.Find ("ImageTarget");

        longClickImage1 = GameObject.Find ("LongClickImage1");
        longClickImage2 = GameObject.Find ("LongClickImage2");
        longClickImage3 = GameObject.Find ("LongClickImage3");
        longClickImage4 = GameObject.Find ("LongClickImage4");
        longClickImage5 = GameObject.Find ("LongClickImage5");
        longClickImage6 = GameObject.Find ("LongClickImage6");

        linkingImage1 = GameObject.Find ("LinkingImage1");
        linkingImage2 = GameObject.Find ("LinkingImage2");
        linkingImage3 = GameObject.Find ("LinkingImage3");
        linkingImage4 = GameObject.Find ("LinkingImage4");
        linkingImage5 = GameObject.Find ("LinkingImage5");
        linkingImage6 = GameObject.Find ("LinkingImage6");

        linkButton = GameObject.Find ("LinkButton").GetComponent<Button> ();

        linkButton.onClick.AddListener (delegate {
            LinkButtonFunction();
        });

        setLongClickImage (-1);
    }