I started this project while taking a course on Udemy. In the course, the instructor has you in Unity 4.6 and then later in unity 5.x. I have taken what was done in the course and made changes and expanded on the game as a learning experience. My first step was to upgrade the whole thing to the version of Unity (5.5). In the course, the code below simply set the startColor of the particle system. I wanted the start color to be the same color as the SpriteRender. I have the following code:
void Puff(){
GameObject smokePuff = Instantiate(smoke, transform.position, Quaternion.identity)as GameObject;
smokePuff.GetComponent<ParticleSystem>().startColor = gameObject.GetComponent<SpriteRenderer>().color;
So now I get the warning:
Warning CS0618 ‘ParticleSystem.startColor’ is obsolete: ‘startColor
property is deprecated. Use main.startColor instead.’
I tried several things and cannot seem to get rid of this warning.
The closest answer I have been able to find is at:
[Unity - Scripting API: ParticleSystem.MainModule.startColor][1]
However, this article shows changing the color directly and I want to set the color to be the same color as the SpriteRender.
Question: The code actually does work in spite of the warning. It is the only warning I get as I have already addressed all the other changes in my game to get things in line with Unity 5.5. Should I just ignore the warning?
If ignoring the warning is a no-no then I am stumped. Any suggestions would be appreciated.