// Use this for initialization void Start() { if (!spaceActivate) { icBinkMaterial bm = this.GetComponent <icBinkMaterial>(); if (bm != null) { bm.getBinkPlayOptions().movieSpeed = speed; } else { Debug.Log("null"); } } }
protected void loadMovie() { Transform t = GameObject.Instantiate(this.sampleQuad) as Transform; t.gameObject.SetActive(true); icBinkMaterial ibm = t.gameObject.AddComponent <icBinkMaterial>(); ibm.isGameSpeedAgnostic = true; ibm.filePath = this.binkFiles[currentIndex]; t.GetComponent <BinkPlayOptions>().movieSpeed = 1.0f; this.currentQuad = t; t.SetParent(this.transform); }
// Update is called once per frame void Update() { if (Input.GetKeyDown("space") && this.spaceActivate) { icBinkMaterial bm = this.GetComponent <icBinkMaterial>(); if (bm != null) { if (bm.getBinkPlayOptions().movieSpeed == speed) { bm.getBinkPlayOptions().movieSpeed = 0.0f; } else { bm.getBinkPlayOptions().movieSpeed = speed; } } } }
/// Give an existing GameObject an icBinkMaterial with a given local Bink file. public icBinkMaterial CreateBinkMaterial(string filePath, GameObject go) { if (ToolbeltManager.FirstInstance.useBink) { icBinkMaterial mat = go.GetComponent <icBinkMaterial>(); if (mat == null) { mat = go.AddComponent <icBinkMaterial>(); } BinkPlugin bp = go.GetOrAddComponent <BinkPlugin>(); mat.LoadMovie(filePath, bp); return(mat); } else { Debug.LogWarning("Tried to CreateBinkMaterial() when ToolbeltManager::useBink is false. Returning null. \"" + filePath + "\""); return(null); } }