Пример #1
0
    // overrides
    public override void AssociateWithComponent(object obj)
    {
        base.AssociateWithComponent(obj);
        mComponent = (Light)obj;

        if (mComponent.cookie != null)
        {
            mCookieTexture = GLexTexture.Get(mComponent.cookie as Texture2D);
        }
    }
Пример #2
0
 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);
 }
Пример #3
0
    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);
    }
Пример #5
0
    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);
    }
Пример #6
0
    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>();
    }
    // overrides
    public override void AssociateWithComponent(object obj)
    {
        base.AssociateWithComponent(obj);
        mComponent = (Light)obj;

        if (mComponent.cookie != null) {
            mCookieTexture = GLexTexture.Get(mComponent.cookie as Texture2D);
        }
    }
Пример #8
0
    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 ];
 }