Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing material of Volume spot at creation?
#2
Hi
  1. Assigning the material to the prefab at runtime leads to that problem because the material you assigned is runtime created, meaning it stops existing once you exit play mode, while the prefab is persistent.
  2. A solution is to use the Input Meshes module instead of the Input GameObjects. This module allows you to set the material as you wish.
  3. The solution you thought about, assigning a material to each created mesh, while is not the best solution, is possible. Here is how to listen on OnRefresh event of a generator. Same event exists also for each module.
    Code:
    using FluffyUnderware.Curvy;
    using FluffyUnderware.Curvy.Generator;
    using UnityEngine;

    public class Test : MonoBehaviour
    {
        void Start()
        {
            GetComponent<CurvyGenerator>().OnRefresh.AddListenerOnce(WhenGeneratorIsRefreshed);
        }

        private void WhenGeneratorIsRefreshed(CurvyCGEventArgs arg0)
        {
            Debug.Log("Refeshed");
        }
    }
  4. Allow me to ask questions about your issue with leaving a review. Can you try to download the asset from both the asset store (on browser), and from the package manager window (which lists assets too if you select that in the selector). Is the issue still present? If so, can you please send me the invoice number so that I contact Unity's customer support? You probably are not the only one with this issue.
  5. Thanks a lot for thinking about donation. You really don't have to, but if you really want to, I will send you details via private message.
Will answer you other post soon.
Until then, have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: Changing material of Volume spot at creation? - by _Aka_ - 08-10-2023, 10:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Question Volume Spots inter group distance Sacryn 1 3 02-27-2024, 04:08 PM
Last Post: _Aka_
  Changing Lanes Antonio 1 11 09-17-2023, 08:23 PM
Last Post: _Aka_

Forum Jump: