Beispiel #1
0
    protected virtual void Start()
    {
        vmap = mapObject.GetComponent <VtsMap>().GetVtsMap();
        Debug.Assert(vmap != null);
        vcam     = new vts.Camera(vmap);
        ucam     = GetComponent <UnityEngine.Camera>();
        camTrans = GetComponent <Transform>();
        mapTrans = mapObject.GetComponent <Transform>();

        shaderPropertyMainTex = Shader.PropertyToID("_MainTex");
        shaderPropertyMaskTex = Shader.PropertyToID("_MaskTex");
        shaderPropertyUvMat   = Shader.PropertyToID("_UvMat");
        shaderPropertyUvClip  = Shader.PropertyToID("_UvClip");
        shaderPropertyColor   = Shader.PropertyToID("_Color");
        shaderPropertyFlags   = Shader.PropertyToID("_Flags");

        shaderPropertyAtmViewInv        = Shader.PropertyToID("vtsUniAtmViewInv");
        shaderPropertyAtmColorHorizon   = Shader.PropertyToID("vtsUniAtmColorHorizon");
        shaderPropertyAtmColorZenith    = Shader.PropertyToID("vtsUniAtmColorZenith");
        shaderPropertyAtmSizes          = Shader.PropertyToID("vtsUniAtmSizes");
        shaderPropertyAtmCoefficients   = Shader.PropertyToID("vtsUniAtmCoefs");
        shaderPropertyAtmCameraPosition = Shader.PropertyToID("vtsUniAtmCameraPosition");
        shaderPropertyAtmCorners        = Shader.PropertyToID("uniCorners");

        backgroundMaterial  = Instantiate(backgroundMaterial);
        backgroundCmds      = new CommandBuffer();
        backgroundCmds.name = "Vts Atmosphere Background";
        ucam.AddCommandBuffer(CameraEvent.BeforeForwardOpaque, backgroundCmds);
        ucam.AddCommandBuffer(CameraEvent.BeforeLighting, backgroundCmds);

        if (Config.Length > 0)
        {
            vcam.SetOptions(Config);
        }
    }
Beispiel #2
0
 private void Start()
 {
     vmap      = mapObject.GetComponent <VtsMap>().GetVtsMap();
     vcam      = new vts.Camera(vmap);
     probTrans = GetComponent <Transform>();
     mapTrans  = mapObject.GetComponent <Transform>();
 }
 private void Start()
 {
     vmap       = mapObject.GetComponent <VtsMap>().GetVtsMap();
     vcam       = new vts.Camera(vmap);
     probTrans  = GetComponent <Transform>();
     mapTrans   = mapObject.GetComponent <Transform>();
     partsGroup = new GameObject(name + " - parts").transform;
 }