So i started coding in c# and downloaded the standard assets for Unity 5 and Imported the Assets which included tech demos. Like that one scene where you can place flares and makes explosions. Now i took the explosion script and added a public static int which i now want to change in another script. But Visual Studios always says: “The name “ParticleSystemMultplier” does not exsit in the current context” So what im doing wrong?
Here is the script I started to make:
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
// Use this for initialization
void Changer () {
int particlesystemmultiplier = ParticleSystemMultiplier.test;
}
// Update is called once per frame
void Update () {
}
}
and here the modified ParticleSystemMultiplier script:
using System;
using UnityEngine;
namespace UnityStandardAssets.Effects
{
public class ParticleSystemMultiplier : MonoBehaviour
{
// a simple script to scale the size, speed and lifetime of a particle system
public static int test = 0;
public float multiplier = 1;
public class varchange : MonoBehaviour {int test = 1;}
void Start()
{ if (test == 1) {
var systems = GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem system in systems)
{
system.startSize *= multiplier;
system.startSpeed *= multiplier;
system.startLifetime *= Mathf.Lerp(multiplier, 1, 0.5f);
system.Clear();
system.Play();
} }
}
}
}