public override void OnInspectorGUI() { DrawDefaultInspector(); WeatherScript weatherRenderer = (WeatherScript)target; if (GUILayout.Button("Generate new weather texture")) { weatherRenderer.GenerateAndChangeWeatherTexture(); } }
public void Weather() { LayerMask mask = 1 << 10; currentWeather = Physics.OverlapSphere(transform.position, 0.1f,mask); for (int i = 0; i < currentWeather.Length;i++) { weatherAtIndex = currentWeather[i].gameObject.GetComponent<WeatherScript>(); if (!anchored) { shipHealth = shipHealth - weatherAtIndex.weatherDamage; morale = morale - weatherAtIndex.weatherMoraleDrain; stamina = stamina - weatherAtIndex.weatherStaminaDrain; } } }