Exemplo n.º 1
0
    /// <summary>
    /// Start playing custom MovieTexture array with delay.
    /// </summary>
    /// <returns>
    /// MovieTextures.
    /// </returns>
    /// <param name='mts'>
    /// MovieTextures.
    /// </param>
    /// <param name='delay'>
    /// Delay.
    /// </param>
    public static MovieTexture[] StartMovies(MovieTexture[] mts, float delay)
    {
        GameObject       go  = new GameObject("_PlayMovieTextureIEnumenator");
        PlayMovieTexture pmt = go.AddComponent <PlayMovieTexture>();

        pmt.StartCoroutine(pmt._StartMovies(mts, delay));
        return(mts);
    }
Exemplo n.º 2
0
 void OnEnable()
 {
     pmt = (PlayMovieTexture)target;
 }
Exemplo n.º 3
0
    void Kinect_SingleUserUpdate(Body body)
    {
        if (body.IsTracked)
        {
            //Resize Unity Player Size & stop movie & hide startinfo
            if (!screenSet)
            {
                if (lang == "jp")
                {
                    setFont(balloon_text, bokutachi);
                }

                //Message.SetActive(true);
                //Time.captureFramerate = 60;
                PlayMovieTexture.StopAllMovies();
                GameMask.SetActive(false);
                //Status.SetActive(true);
                //Status_panel.GetComponent<RawImage>().CrossFadeAlpha(1000, 2.0f, false);
                //Application.ExternalCall("screenSize", "ok");
                screenSet = true;
                //MessageController.GetComponent<MessageController>().playClip(1);
                //balloon.GetComponent<RectTransform>().localPosition = new Vector3(88.5f, balloon.GetComponent<RectTransform>().localPosition.y, balloon.GetComponent<RectTransform>().localPosition.z);
                //balloon_text.GetComponent<RectTransform>().localPosition = new Vector3(89.7f, balloon_text.GetComponent<RectTransform>().localPosition.y, balloon_text.GetComponent<RectTransform>().localPosition.z);
                //helper.GetComponent<Transform>().localPosition = new Vector3(215f, helper.GetComponent<Transform>().localPosition.y, helper.GetComponent<Transform>().localPosition.z);
                helper.SetActive(true);
                balloon.SetActive(true);
                balloon_text.SetActive(true);

                changeAni("pose_00");
                set_timer.Start();
            }

            for (JointType jt = JointType.SpineBase; jt <= JointType.ThumbRight; jt++)
            {
                // 조인트 조건.
                if (jt != JointType.KneeLeft && jt != JointType.KneeRight && jt != JointType.AnkleLeft && jt != JointType.AnkleRight && jt != JointType.HandTipLeft && jt != JointType.HandTipRight && jt != JointType.Neck &&
                    jt != JointType.HipLeft && jt != JointType.HipRight && jt != JointType.SpineBase)
                {
                    if (!Joints.ContainsKey(jt.ToString()))
                    {
                        //add Joints to dictionary
                        Joints.Add(jt.ToString(), new GameObject(jt.ToString()));
                        Joints[jt.ToString()].transform.parent = GameObject.Find("Canvas").transform;

                        if (jt.ToString() == "Head" || jt.ToString() == "SpineShoulder")
                        {
                            Joints[jt.ToString()].transform.localScale = new Vector3(0, 0, 5);
                        }
                        //set scale of joints object
                        else
                        {
                            Joints[jt.ToString()].transform.localScale = new Vector3(0.15f, 0.15f);
                        }

                        //set meshfilter of joints
                        MeshFilter meshfilter = Joints[jt.ToString()].AddComponent <MeshFilter>();
                        meshfilter.sharedMesh = meshCube.GetComponent <MeshFilter>().mesh;

                        //set meshRendere of joints
                        meshRenderer = Joints[jt.ToString()].AddComponent <MeshRenderer>();

                        //add ClickEvt Sciprt to gameObject
                        Joints[jt.ToString()].AddComponent <ClickEvnt>();
                        Joints[jt.ToString()].transform.parent = GameObject.Find("Canvas").transform;
                    }

                    // 뼈 색
                    //if (side.flag["err"] == true)
                    //{
                    //    Joints[jt.ToString()].GetComponent<MeshRenderer>().material = materialR;
                    //}
                    //else
                    //{
                    //    Joints[jt.ToString()].GetComponent<MeshRenderer>().material = materialG;
                    //}


                    // SideCheck에서 쓸 변수 값 정의
                    if (!JointInfo.ContainsKey(jt.ToString()))
                    {
                        JointInfo.Add(jt.ToString(), body.Joints[jt].Position);
                    }
                    else
                    {
                        JointInfo[jt.ToString()] = body.Joints[jt].Position;
                    }

                    //Set Position of Joints in display by frame
                    Joints[jt.ToString()].transform.position = cm.MapCameraPointToColorSpace(body.Joints[jt]);
                }
            }


            // 뼈대 생성 메서드
            makeBones();



            //뼈 색 조절
            //depthJointColor();

            //side 의 main 함수를 계속 실행.
            side.main();

            //텍스트 색 조절 및 값 조절
            textController();


            //소리 실행
            Sound_Controller();
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        //call javascript function
        Application.ExternalCall("orderPlus", "ok");
        Application.ExternalCall("UnityReady", "ok");

        //get jap font
        bokutachi = Resources.Load("Fonts/bokutachi", typeof(Font)) as Font;

        if (!GameObject.Find("BGM"))
        {
            BGM = new GameObject("BGM");
            BGM.AddComponent <AudioSource>();
            BGM.AddComponent <MusicSingleton>();
        }
        else
        {
            this.BGM = GameObject.Find("BGM");
        }


        MessageController = new GameObject("MessageController");
        MessageController.AddComponent <AudioSource>();
        MessageController.AddComponent <MessageController>();
        msgController = gameObject.GetComponent("ScriptName") as MessageController;

        //helper
        helper          = GameObject.Find("helper");
        changeAnimation = gameObject.GetComponent("ScriptName") as changeAnimation;
        helper.SetActive(false);
        balloon = GameObject.Find("balloon");
        balloon.SetActive(false);
        balloon_text = GameObject.Find("balloon_text");
        balloon_text.SetActive(false);

        //angle object


        armpLeftDegree  = GameObject.Find("armpRightDegree");
        armpRightDegree = GameObject.Find("armpLeftDegree");



        //clear EngagedUser
        KinemotoSDK.EngagementHandler.EngagedPlayers.Clear();
        KinemotoSDK.EngagementHandler.EngagedUsers.Clear();
        KinemotoSDK.EngagementHandler.HandRaiseCounter.Clear();


        //screenResize
        Application.ExternalCall("screenResize", "ok");

        //particle effect set
        particle = Instantiate(Resources.Load("particle")) as GameObject;
        particle.SetActive(false);
        particle.transform.parent = GameObject.Find("Canvas").transform;
        particle_position         = new Vector3(0, 0);

        //firewall effect set

        firework = GameObject.Find("firework");
        if (firework.activeInHierarchy)
        {
            firework.SetActive(false);
        }



        //Timer
        Timer = GameObject.Find("Timer");
        set_timer.Reset();

        //movie texture set
        movieTexture = GameObject.Find("GUITexture Video");
        movieTexture.transform.parent = GameObject.Find("Panel").transform;
        PlayMovieTexture.StartAllMovies();


        //panel set
        panel = GameObject.Find("Panel");

        breakTimeMask = GameObject.Find("breakTimeMask");


        breakTimeMask.SetActive(false);

        //Status.SetActive(false);
        breakTimeMask.SetActive(false);
        prefab                         = Resources.Load("prefabs/ToggleListMenu4Canvas1") as GameObject;
        Status                         = GameObject.Instantiate(prefab) as GameObject;
        Status.name                    = "status";
        Status.transform.parent        = GameObject.Find("Canvas").transform;
        Status.transform.localPosition = new Vector3(470f, -30f, -10);
        Status.transform.localScale    = new Vector3(0.711432f, 1.08361f, 0.7343858f);


        //title = GameObject.Find("title");
        title   = GameObject.Find("Title");
        Message = GameObject.Find("Message");
        Message.SetActive(false);


        //what's wrong
        checkPoint1   = GameObject.Find("CheckPoint1");
        checkPoint1_1 = GameObject.Find("CheckPoint1_1");
        checkPoint1_2 = GameObject.Find("CheckPoint1_2");

        checkPoint2   = GameObject.Find("CheckPoint2");
        checkPoint2_1 = GameObject.Find("CheckPoint2_1");
        checkPoint2_2 = GameObject.Find("CheckPoint2_2");

        //practice mod
        Mark1_1 = GameObject.Find("Mark1_1");
        Mark1_2 = GameObject.Find("Mark1_2");
        //Mark1_3 = GameObject.Find("Mark1_3");
        Mark2_1 = GameObject.Find("Mark2_1");
        Mark2_2 = GameObject.Find("Mark2_2");
        //Mark2_3 = GameObject.Find("Mark2_3");

        Mark1_1.SetActive(false);
        Mark1_2.SetActive(false);
        //Mark1_3.SetActive(false);
        Mark2_1.SetActive(false);
        Mark2_2.SetActive(false);
        //Mark2_3.SetActive(false);
        lang = "jp";
        if (lang == "kr")
        {
            checkPoint1.GetComponentInChildren <Text>().text = "팔을 올릴 때";
        }
        else if (lang == "jp")
        {
            setFont(checkPoint1, bokutachi);
            checkPoint1.GetComponentInChildren <Text>().text = "腕を上がるとき";
        }
        checkPoint1.GetComponentInChildren <Text>().horizontalOverflow   = HorizontalWrapMode.Overflow;
        checkPoint1_1.GetComponentInChildren <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
        checkPoint1_2.GetComponentInChildren <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;

        checkPoint1.GetComponentInChildren <Text>().color   = Color.black;
        checkPoint1_1.GetComponentInChildren <Text>().color = Color.black;
        checkPoint1_2.GetComponentInChildren <Text>().color = Color.black;

        if (lang == "kr")
        {
            checkPoint2.GetComponentInChildren <Text>().text = "팔을 내릴 때";
        }
        else if (lang == "jp")
        {
            setFont(checkPoint2, bokutachi);
            checkPoint2.GetComponentInChildren <Text>().text = "腕を下げるとき";
        }

        checkPoint2.GetComponentInChildren <Text>().horizontalOverflow   = HorizontalWrapMode.Overflow;
        checkPoint2_1.GetComponentInChildren <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
        checkPoint2_2.GetComponentInChildren <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;

        checkPoint2.GetComponentInChildren <Text>().color   = Color.black;
        checkPoint2_1.GetComponentInChildren <Text>().color = Color.black;
        checkPoint2_2.GetComponentInChildren <Text>().color = Color.black;



        Status.SetActive(false);

        //goal set
        SetGoal   = GameObject.Find("SetGoals");
        ScoreGoal = GameObject.Find("ScoreGoals");

        //set material to BoneMaterial
        materialW = Resources.Load("BoneMaterialW", typeof(Material)) as Material;
        materialR = Resources.Load("BoneMaterialR", typeof(Material)) as Material;
        materialG = Resources.Load("BoneMaterialG", typeof(Material)) as Material;

        //create cube object for mesh fitter
        meshCube  = GameObject.CreatePrimitive(PrimitiveType.Cube);
        meshCube2 = GameObject.CreatePrimitive(PrimitiveType.Cube);
        meshCube3 = GameObject.CreatePrimitive(PrimitiveType.Cube);

        //set gameobject name to "meshCube"
        meshCube.name  = "meshCube";
        meshCube2.name = "meshCube2";
        meshCube3.name = "meshCube3";

        //set position of meshcube to back of the display
        meshCube.transform.position  = new Vector3(0, 0, 20);
        meshCube2.transform.position = new Vector3(0, -5, 20);
        meshCube3.transform.position = new Vector3(0, -5, 20);

        //생성자



        side = new SideCheck();

        ConfigureCoordinateMapper(mapRenderer);

        //camera
        MainCamera  = GameObject.Find("Main Camera");
        SplitCamera = GameObject.Find("Split Camera");
        SplitCamera.SetActive(false);

        Application.ExternalCall("init_score", 0);
    }