private void Start()
 {
     // Create the decals mesh (intermediate mesh data) for our decals instance.
     // Further we need a decals mesh cutter instance.
     m_DecalsMesh       = new DecalsMesh();
     m_DecalsMeshCutter = new DecalsMeshCutter();
 }
        private void Start()
        {
            if (Edition.IsDecalSystemFree)
            {
                Debug.Log("This demo only works with Decal System Pro.");
                enabled = false;
            }
            else
            {
                // Instantiate the prefab and get its decals instance.
                m_DecalsInstance = Instantiate(m_DecalsPrefab) as DS_Decals;

                if (m_DecalsInstance == null)
                {
                    Debug.LogError("The decals prefab does not contain a DS_Decals instance!");
                }
                else
                {
                    // Create the decals mesh and the cutter that are needed to compute the projections.
                    // We also cache the world to decals matrix.
                    m_DecalsMesh = new DecalsMesh(m_DecalsInstance);
                    m_DecalsMesh.PreserveProjectedUVArrays = true;
                    m_DecalsMeshCutter    = new DecalsMeshCutter();
                    m_WorldToDecalsMatrix = m_DecalsInstance.CachedTransform.worldToLocalMatrix;

                    StartCoroutine(UpdateUVRectangleIndices());
                }
            }
        }
Exemplo n.º 3
0
    private void Start()
    {
        // Instantiate the prefab and get its decals instance.
        GameObject l_Instance = Instantiate (decalsPrefab) as GameObject;
        m_Decals = l_Instance.GetComponentInChildren <DS_Decals> ();

        if (m_Decals == null) {
            Debug.LogError ("The 'decalsPrefab' does not contain a 'DS_Decals' instance!");
        } else {

                // Create the decals mesh (intermediate mesh data) for our decals instance.
                // Further we need a decals mesh cutter instance and the world to decals matrix.
            m_DecalsMesh = new DecalsMesh (m_Decals);
            m_DecalsMeshCutter = new DecalsMeshCutter ();
            m_WorldToDecalsMatrix = m_Decals.CachedTransform.worldToLocalMatrix;
        }
    }
        private void Start()
        {
            // Instantiate the prefab and get its decals instance.
            m_DecalsInstance = Instantiate(m_DecalsPrefab) as DS_Decals;

            if (m_DecalsInstance == null)
            {
                Debug.LogError("The decals prefab does not contain a DS_Decals instance!");
            }
            else
            {
                // Create the decals mesh and the cutter that are needed to compute the projections.
                // We also cache the world to decals matrix.
                m_DecalsMesh          = new DecalsMesh(m_DecalsInstance);
                m_DecalsMeshCutter    = new DecalsMeshCutter();
                m_WorldToDecalsMatrix = m_DecalsInstance.CachedTransform.worldToLocalMatrix;
            }
        }
Exemplo n.º 5
0
    private void Start()
    {
        // Instantiate the prefab and get its decals instance.
        GameObject l_Instance = Instantiate(decalsPrefab) as GameObject;

        m_Decals = l_Instance.GetComponentInChildren <DS_Decals> ();

        if (m_Decals == null)
        {
            Debug.LogError("The 'decalsPrefab' does not contain a 'DS_Decals' instance!");
        }
        else
        {
            // Create the decals mesh (intermediate mesh data) for our decals instance.
            // Further we need a decals mesh cutter instance and the world to decals matrix.
            m_DecalsMesh          = new DecalsMesh(m_Decals);
            m_DecalsMeshCutter    = new DecalsMeshCutter();
            m_WorldToDecalsMatrix = m_Decals.CachedTransform.worldToLocalMatrix;
        }
    }
        private void Start()
        {
            // Instantiate the prefab and get its decals instance.
            m_DecalsInstance = Instantiate(m_DecalsPrefab) as DS_Decals;

            // Make sure the decals move with this dynamic object.
            m_DecalsInstance.transform.parent        = transform;
            m_DecalsInstance.transform.localPosition = Vector3.zero;
            m_DecalsInstance.transform.localScale    = Vector3.one;

            if (m_DecalsInstance == null)
            {
                Debug.LogError("The decals prefab does not contain a DS_Decals instance!");
            }
            else
            {
                // Create the decals mesh and the cutter that are needed to compute the projections.
                m_DecalsMesh       = new DecalsMesh(m_DecalsInstance);
                m_DecalsMeshCutter = new DecalsMeshCutter();
            }
        }
Exemplo n.º 7
0
        private void Start()
        {
            if (Edition.IsDecalSystemFree) {
                Debug.Log ("This demo only works with Decal System Pro.");
                enabled = false;
            } else {

                    // Instantiate the prefab and get its decals instance.
                m_DecalsInstance = Instantiate (m_DecalsPrefab) as DS_Decals;
                m_DecalsInstance.UseVertexColors = true;

                if (m_DecalsInstance == null) {
                    Debug.LogError ("The decals prefab does not contain a DS_Decals instance!");
                } else {

                        // Create the decals mesh and the cutter that are needed to compute the projections.
                        // We also cache the world to decals matrix.
                    m_DecalsMesh = new DecalsMesh (m_DecalsInstance);
                    m_DecalsMeshCutter = new DecalsMeshCutter ();
                    m_WorldToDecalsMatrix = m_DecalsInstance.CachedTransform.worldToLocalMatrix;
                }
            }
        }
Exemplo n.º 8
0
        private void Start()
        {
            // Instantiate the prefab and get its decals instance.
            m_DecalsInstance = Instantiate (m_DecalsPrefab) as DS_Decals;

            if (m_DecalsInstance == null) {
                Debug.LogError ("The decals prefab does not contain a DS_Decals instance!");
            } else {

                    // Create the decals mesh and the cutter that are needed to compute the projections.
                    // We also cache the world to decals matrix.
                m_DecalsMesh = new DecalsMesh (m_DecalsInstance);
                m_DecalsMeshCutter = new DecalsMeshCutter ();
                m_WorldToDecalsMatrix = m_DecalsInstance.CachedTransform.worldToLocalMatrix;
            }
        }
Exemplo n.º 9
0
 private void Start()
 {
     // Create the decals mesh and the cutter that are needed to compute the projections.
     m_DecalsMesh = new DecalsMesh ();
     m_DecalsMeshCutter = new DecalsMeshCutter ();
 }
Exemplo n.º 10
0
        private void Start()
        {
            // Instantiate the prefab and get its decals instance.
            m_DecalsInstance = Instantiate (m_DecalsPrefab) as DS_Decals;

                // Make sure the decals move with this dynamic object.
            m_DecalsInstance.transform.parent = transform;
            m_DecalsInstance.transform.localPosition = Vector3.zero;
            m_DecalsInstance.transform.localScale = Vector3.one;

            if (m_DecalsInstance == null) {
                Debug.LogError ("The decals prefab does not contain a DS_Decals instance!");
            } else {

                    // Create the decals mesh and the cutter that are needed to compute the projections.
                m_DecalsMesh = new DecalsMesh (m_DecalsInstance);
                m_DecalsMeshCutter = new DecalsMeshCutter ();
            }
        }
 private void Start()
 {
     // Create the decals mesh and the cutter that are needed to compute the projections.
     m_DecalsMesh       = new DecalsMesh();
     m_DecalsMeshCutter = new DecalsMeshCutter();
 }