// overrides public override void AssociateWithComponent(object obj) { base.AssociateWithComponent(obj); mComponent = (Light)obj; if (mComponent.cookie != null) { mCookieTexture = GLexTexture.Get(mComponent.cookie as Texture2D); } }
private GLexTexture GetSkyboxSide(string texName) { if (_skybox.material != null) { var tex = _skybox.material.GetTexture(texName) as Texture2D; if (tex != null) { return(GLexTexture.Get(tex)); } } return(null); }
private void AddTextures() { mTextures = new List <GLexTexture>(); foreach (KeyValuePair <string, string> uniform in GLexConfig.TextureUniforms) { if (mMaterial.HasProperty(uniform.Value)) { Texture2D texture = mMaterial.GetTexture(uniform.Value) as Texture2D; mTextures.Add(GLexTexture.Get(texture)); } } }
public GooSkybox(Skybox pSkybox) { _skybox = pSkybox; _top = GetSkyboxSide("_UpTex"); _bottom = GetSkyboxSide("_DownTex"); _left = GetSkyboxSide("_LeftTex"); _right = GetSkyboxSide("_RightTex"); _front = GetSkyboxSide("_FrontTex"); _back = GetSkyboxSide("_BackTex"); AllSkyboxes.Add(this); }
public GLexData() { Instance = this; GLexMaterial.Reset(); GLexMesh.Reset(); GLexTexture.Reset(); GLexShader.Reset(); GLexSkinnedMeshRenderer.Reset(); GLexBone.Reset(); GLexAnimation.Reset(); GLexAnimationClip.Reset(); GLexAnimationState.Reset(); GooSkybox.Reset(); GLexAudioSource.Reset(); GooSkeleton.Reset(); mGLexGameObjects = new List <GLexGameObject>(); mGLexTopGameObjects = new List <GLexGameObject>(); mGLexComponents = new List <GLexComponent>(); }
public void PrepareForExport() { if (GLexConfig.GetOption(GLexConfig.SETUNIQUENAMES)) { Dictionary <string, int> uniqueNames = new Dictionary <string, int>(); foreach (GLexGameObject gameObject in mGLexGameObjects) { if (gameObject.Settings == null) { _addedSettingsTo.Add(gameObject); gameObject.AddSettings(); } else { gameObject.ResetSettingsExportName(); } } foreach (GLexGameObject gameObject in mGLexGameObjects) { if (uniqueNames.ContainsKey(gameObject.Settings.UniqueName)) { gameObject.Settings.UniqueName = gameObject.Settings.UniqueName + (++uniqueNames[gameObject.Settings.UniqueName]).ToString(); } else { uniqueNames.Add(gameObject.Settings.UniqueName, 0); } } } // Keep preparing objects while new ones are being added int prevGameObjectCount = 0, prevComponentCount = 0; while (prevGameObjectCount < mGLexGameObjects.Count || prevComponentCount < mGLexComponents.Count) { int goStart = prevGameObjectCount; int gcStart = prevComponentCount; prevGameObjectCount = mGLexGameObjects.Count; prevComponentCount = mGLexComponents.Count; for (int i = goStart; i < prevGameObjectCount; ++i) { mGLexGameObjects[i].PrepareForExport(); } for (int i = gcStart; i < prevComponentCount; ++i) { mGLexComponents[i].PrepareForExport(); } } // find top objects foreach (GLexGameObject gameObject in mGLexGameObjects) { if (!gameObject.HasParent) { mGLexTopGameObjects.Add(gameObject); } } GLexMaterial.PrepareForExport(); GLexMesh.PrepareForExport(); GLexTexture.PrepareForExport(); GLexShader.PrepareForExport(); GLexSkinnedMeshRenderer.StaticPrepareForExport(); GLexBone.PrepareForExport(); // GLexAnimation .PrepareForExport(); // GLexAnimationClip .PrepareForExport(); mGLexGameObjectsAsArray = mGLexGameObjects.ToArray(); mGLexTopGameObjectsAsArray = mGLexTopGameObjects.ToArray(); mGLexComponentsAsArray = mGLexComponents.ToArray(); mScene.PrepareForExport(); }
public static string TransformTextureFilter( GLexTexture.Filter filter ) { return mTextureFilterTransform[ filter ]; }