Exemple #1
0
 public void PlayClick()
 {
     if (MenuSystem.CanInvoke)
     {
         string    text     = ScriptLocalization.Get("SUBTITLES/" + selectedItem.videoRepositoryItem.name);
         TextAsset videoSrt = HFFResources.instance.GetVideoSrt(selectedItem.videoRepositoryItem.name + "Srt");
         subtitles = new SrtSubtitles();
         subtitles.Load(selectedItem.videoRepositoryItem.name, videoSrt.text);
         videoSrt = null;
         LoadMovie();
     }
 }
    private void Start()
    {
        LoadMovie(videoName);
        TextAsset videoSrt = HFFResources.instance.GetVideoSrt(videoName + "Srt");

        subtitles = new SrtSubtitles();
        subtitles.Load(videoName, videoSrt.text);
        videoSrt  = null;
        collider  = GetComponent <BoxCollider>();
        renderer  = GetComponent <Renderer>();
        filter    = GetComponent <MeshFilter>();
        mesh      = new Mesh();
        mesh.name = "rope " + base.name;
        meshVerts = new Vector3[8];
        uvs       = new Vector2[8];
        Create2SidedMesh(0f, -4.5f, 0f, 4.5f, 0f, 0f, 1f, 1f);
        mesh.vertices  = meshVerts;
        mesh.uv        = uvs;
        mesh.triangles = new int[12]
        {
            0,
            1,
            2,
            0,
            2,
            3,
            4,
            5,
            6,
            4,
            6,
            7
        };
        mesh.RecalculateNormals();
        mesh.RecalculateBounds();
        filter.sharedMesh = mesh;
    }