// Use this for initialization void Start() { StartCoroutine(RollCube()); TextureLoaderPlugin.InitTexturesCallback += InitTextureFinish; TextureLoaderPlugin.UpdateTextureCallback += UpdateTextureFinish; TextureLoaderPlugin.InitTexture(2, 0, initImagePath); }
// Update is called once per frame void Update() { timeCounter += Time.unscaledDeltaTime; if (initTexture && timeCounter > 1) { if (TextureLoaderPlugin.CurrentStatus != TextureLoaderPlugin.TextureLoaderStatus.TLS_IDLE) { return; } timeCounter = 0; int s = (int)Time.unscaledTime % 4; iCurrentUpdateTexID = (s % 2 == 0 ? iLeftTexID : iRightTexID); string updatePath = (s < 2) ? updateImagePath1 : updateImagePath2; if (!TextureLoaderPlugin.UpdateTexture(updatePath, 0, iCurrentUpdateTexID)) { Debug.LogWarning("Could not update texture right now!"); iCurrentUpdateTexID = 0; } } }
void Awake() { TextureLoaderPlugin.Init(); }