private void SetTextureSide(Renderer sideRenderer, float number) { if (mCubeTexture == null) { mCubeTexture = GameData.Get.CubeTextureData; if (mCubeTexture == null) { Debug.LogError("No textureManager loaded", this); return; } } var tex = mCubeTexture.GetTexture((int)number, number - (int)number > 0 ? true: false); sideRenderer.material.mainTexture = tex; }