示例#1
0
    void Awake()
    {
        unistorm = GameObject.FindGameObjectWithTag("UniStorm");

        if (!ReferenceEquals(unistorm, null))
        {
            UniStormWeatherSystem_C[] weathers = unistorm.GetComponentsInChildren <UniStormWeatherSystem_C>();
            UniStormWeatherSystem_C   weather  = weathers[0];

            if (!ReferenceEquals(weather, null))
            {
                weather.rain           = rain;
                weather.snow           = snow;
                weather.butterflies    = lightningBugs;
                weather.rainMist       = rainMist;
                weather.rainSplashes   = rainSplash;
                weather.lightningSpawn = lightningPosition;
                weather.snowMistFog    = snowDust;
                weather.mistFog        = rainStreaks;
                weather.windyLeaves    = windyLeaves;
                weather.lightningBolt1 = lightningBolt1;
                weather.cameraObject   = unistormCamera;
            }
        }
    }
示例#2
0
	// Use this for initialization
	void Start () 
	{
		uniStormObject = GameObject.Find("UniStormSystemEditor");
		uniStormSystem = uniStormObject.GetComponent<UniStormWeatherSystem_C>(); 

		WeatherUpdateTimer = WeatherUpdateSeconds - 0.25f;
	}
示例#3
0
	void Start () 
	{
		uniStormObject = GameObject.Find("UniStormSystemEditor");
		uniStormSystem = uniStormObject.GetComponent<UniStormWeatherSystem_C>(); 

		transform.rotation = Quaternion.Euler (0, Random.Range(5,350), 0);
	}
示例#4
0
	//Grab the UniStorm System
	void Start () 
	{
		uniStormObject = GameObject.Find("UniStormSystemEditor");
		uniStormSystem = uniStormObject.GetComponent<UniStormWeatherSystem_C>(); 

		if (intToString == 0)
		{
			variableName = "weatherForecaster";
		}

		if (intToString == 1)
		{
			variableName = "temperature";
		}

		if (intToString == 2)
		{
			variableName = "minuteCounter";
		}

		if (intToString == 3)
		{
			variableName = "hourCounter";
		}

		if (intToString == 4)
		{
			variableName = "dayCounter";
		}
	}
示例#5
0
	void Start () 
	{
		uniStormObject = GameObject.Find("UniStormSystemEditor");
		uniStormSystem = uniStormObject.GetComponent<UniStormWeatherSystem_C>(); 

		TimeSlider.value = uniStormSystem.startTime;

		MouseLook1 = GameObject.Find("Player").GetComponent<MouseLookMobile>();
		MouseLook2 = GameObject.Find("Camera").GetComponent<MouseLookMobile>();
	}
示例#6
0
 // Use this for initialization
 void Awake()
 {
     weatherSys = GameObject.Find("UniStormSystemEditor").GetComponent <UniStormWeatherSystem_C>();
     weatherSys.monthCounter        = 10;
     weatherSys.timeStopped         = timeStopped;
     weatherSys.staticWeather       = staticWeather;
     weatherSys.startTimeHour       = startTime;
     weatherSys.numberOfDaysInMonth = 3;
     if (!timeStopped)
     {
         weatherSys.dayLength   = dayTime;
         weatherSys.nightLength = nightTime;
     }
     ChangeWeather(initialWeather);
 }
示例#7
0
	void Start () 
	{
		uniStormSystem = GameObject.Find("UniStormSystemEditor");
		uniStormsScript = uniStormSystem.GetComponent<UniStormWeatherSystem_C>();
	}
 void Awake()
 {
     //Find the UniStorm Weather System Editor, this must match the UniStorm Editor name
     uniStormSystem       = GameObject.Find("UniStormSystemEditor");
     uniStormSystemScript = uniStormSystem.GetComponent <UniStormWeatherSystem_C>();
 }
 void Start()
 {
     //Find the UniStorm Weather System Editor, this must match the UniStorm Editor name
     uniStormSystem = GameObject.Find("UniStormSystemEditor");
     uniStormSystemScript = uniStormSystem.GetComponent<UniStormWeatherSystem_C>();
 }
示例#10
0
 // Use this for initialization
 void Start()
 {
     weatherSys = GameObject.Find("UniStormSystemEditor").GetComponent <UniStormWeatherSystem_C>();
     m_grab     = GetComponent <grabObject>();
 }
示例#11
0
	void OnGUI()
	{
		GUILayout.Label ("UniStorm Auto Player Setup - v1.0", EditorStyles.boldLabel);

		EditorGUILayout.HelpBox("UniStorm's new Auto Player Setup makes it easier than ever to setup custom characters with UniStorm. Simply attach your player and UniStorm will handle the rest. If you have 2 cameras, UniStorm will also handle this. UniStorm will auto assign and position all particle effects, setup and assign the camera, and apply them to UniStorm.", MessageType.None, true);

		BeginWindows();
		EditorGUILayout.HelpBox("You will need to assign your Player Object here in order for the Auto Assign system to properly apply all needed components. You will then be able to press the Auto Setup Player button.", MessageType.None, true);
		//PlayerObject = (GameObject)EditorGUI.ObjectField(new Rect(3, 160, position.width - 6, 16), "Player Object", PlayerObject, typeof(GameObject));
		PlayerObject = (GameObject)EditorGUILayout.ObjectField("Player Object", PlayerObject, typeof(GameObject), true);
		EndWindows();

		GUILayout.Space(15);

		//BeginWindows();
		//EditorGUILayout.HelpBox("Does your player have more than 1 camera?", MessageType.None, true);
		//EndWindows();

		BeginWindows();
		EditorGUILayout.HelpBox("Is your player using UFPS?", MessageType.None, true);
		EndWindows();

		yes = EditorGUILayout.Toggle ("Yes", yes);
		no = EditorGUILayout.Toggle ("No", no);

		if (yes)
		{
			GUILayout.Space(15);

			BeginWindows();
			//EditorGUILayout.HelpBox("Assign your scene rendering camera here. This would be the camera that renders the level, not the camera that renders any FPS weapon. For example, if you were using UFPS, you would assign the FPSCamera object.", MessageType.None, true);

			EditorGUILayout.HelpBox("Assign your cameras and player object to the appropriate slots.", MessageType.None, true);

			//PlayerCamera = (Camera)EditorGUILayout.ObjectField("PlayerObject", PlayerCamera, typeof(Camera), true);
			PlayerCamera = (Camera)EditorGUILayout.ObjectField("FPS Camera", PlayerCamera, typeof(Camera), true);
			PlayerCamera2 = (Camera)EditorGUILayout.ObjectField("Weapon Camera", PlayerCamera2, typeof(Camera), true);

			EndWindows();
		}

		EditorGUI.BeginDisabledGroup (yes == false && no == false || yes == true && no == true || PlayerObject == null || PlayerCamera == null && yes == true);

		GUILayout.Space(15);

		EditorGUILayout.HelpBox("Auto Setup Player will attach several particle effects to your player. This system will also alter the Far Clipping Plane on your camera. \n\nNote: If you already have UniStorm's particle effects on your player, you will need to remove them for the auto setup system to continue.", MessageType.None, true);

		if (GUILayout.Button("Auto Setup Player") && GameObject.Find("Rain/Splashes") == null)
		{
			startVal = (float)EditorApplication.timeSinceStartup;


			UniStormGameObject = GameObject.Find("UniStormSystemEditor");
			UniStormSystem = UniStormGameObject.GetComponent<UniStormWeatherSystem_C>();

			if (yes)
			{
				PlayerCamera.farClipPlane = 18200;
				UniStormSystem.cameraObject = PlayerCamera2.gameObject;
			}

			if (no)
			{
				Camera PlayerCameraComponent = PlayerObject.GetComponentInChildren<Camera>();
				PlayerCameraComponent.farClipPlane = 18200;
				UniStormSystem.cameraObject = PlayerCameraComponent.gameObject;
			}


			ParticleSystem RainPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Rain.prefab", typeof(ParticleSystem));
			ParticleSystem Rain = ((ParticleSystem)Instantiate (RainPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			Rain.gameObject.name = "Rain";
			Rain.gameObject.transform.parent = PlayerObject.transform;
			Rain.gameObject.transform.localPosition = new Vector3 (0,30,0);
			Rain.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.rain = Rain;
			UniStormSystem.rainSplashes = GameObject.Find("Rain/Splashes").GetComponent<ParticleSystem>();

			ParticleSystem RainMistPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Rain Mist.prefab", typeof(ParticleSystem));
			ParticleSystem RainMist = ((ParticleSystem)Instantiate (RainMistPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			RainMist.gameObject.name = "Rain Mist";
			RainMist.gameObject.transform.parent = PlayerObject.transform;
			RainMist.gameObject.transform.localPosition = new Vector3 (0,37,0);
			RainMist.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.rainMist = RainMist;

			GameObject MistFogPrefab = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Rain Streaks.prefab", typeof(GameObject));
			GameObject MistFog = ((GameObject)Instantiate (MistFogPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			MistFog.gameObject.name = "Rain Streaks";
			MistFog.gameObject.transform.parent = PlayerObject.transform;
			MistFog.gameObject.transform.localPosition = new Vector3 (0,180,0);
			MistFog.gameObject.transform.localRotation = Quaternion.Euler (0,0,0);
			UniStormSystem.mistFog = MistFog;

			ParticleSystem SnowPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Snow.prefab", typeof(ParticleSystem));
			ParticleSystem Snow = ((ParticleSystem)Instantiate (SnowPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			Snow.gameObject.name = "Snow";
			Snow.gameObject.transform.parent = PlayerObject.transform;
			Snow.gameObject.transform.localPosition = new Vector3 (0,25,0);
			Snow.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.snow = Snow;

			ParticleSystem SnowDustPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Snow Dust.prefab", typeof(ParticleSystem));
			ParticleSystem SnowDust = ((ParticleSystem)Instantiate (SnowDustPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			SnowDust.gameObject.name = "Snow Dust";
			SnowDust.gameObject.transform.parent = PlayerObject.transform;
			SnowDust.gameObject.transform.localPosition = new Vector3 (0,37,0);
			SnowDust.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.snowMistFog = SnowDust;

			ParticleSystem ButterfliesPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Lightning Bugs.prefab", typeof(ParticleSystem));
			ParticleSystem Butterflies = ((ParticleSystem)Instantiate (ButterfliesPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			Butterflies.gameObject.name = "Lightning Bugs";
			Butterflies.gameObject.transform.parent = PlayerObject.transform;
			Butterflies.gameObject.transform.localPosition = new Vector3 (0,7.8f,0);
			Butterflies.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.butterflies = Butterflies;

			ParticleSystem WindyLeavesPrefab = (ParticleSystem) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Fall Leaves.prefab", typeof(ParticleSystem));
			ParticleSystem WindyLeaves = ((ParticleSystem)Instantiate (WindyLeavesPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			WindyLeaves.gameObject.name = "Windy Leaves";
			WindyLeaves.gameObject.transform.parent = PlayerObject.transform;
			WindyLeaves.gameObject.transform.localPosition = new Vector3 (0,46,0);
			WindyLeaves.gameObject.transform.localRotation = Quaternion.Euler (270,0,0);
			UniStormSystem.windyLeaves = WindyLeaves;

			Transform LightningSpawnPrefab = (Transform) AssetDatabase.LoadAssetAtPath("Assets/UniStorm (Desktop)/Prefabs (Desktop)/ParticleEffects/Lightning Position.prefab", typeof(Transform));
			Transform LightningSpawn = ((Transform)Instantiate (LightningSpawnPrefab, PlayerObject.transform.position, PlayerObject.transform.rotation));
			LightningSpawn.gameObject.name = "Lightning Position";
			LightningSpawn.gameObject.transform.parent = PlayerObject.transform;
			LightningSpawn.gameObject.transform.localPosition = new Vector3 (-2,27,5);
			LightningSpawn.gameObject.transform.localRotation = Quaternion.Euler (0,0,0);
			UniStormSystem.lightningSpawn = LightningSpawn;


			//Unity 5.1 and below
			//Rain = (GameObject) Resources.LoadAssetAtPath("Assets/Artwork/mymodel.fbx", typeof(ParticleSystem));

		}

		
		if (progress < secs)
			EditorUtility.DisplayProgressBar("Auto Setting Up Player for UniStorm", "Auto assigning needed components...", progress / secs);
		else
			EditorUtility.ClearProgressBar();
		progress = (float)(EditorApplication.timeSinceStartup - startVal);

		//secs = EditorGUILayout.FloatField("Time to wait:", secs);
	}