Hi everyone!
Before starting, I know it’s possible that this question was made by another user, but I didn’t found a solution for me, so I’m posting to see if someone could help me to solve this.
I’ve started following a 2d platformer course a week ago.
I’m not a developer, I’m just learning and using my art to make a game, but everything was going fine until this happened.
I was playing arround with the particles to make a cool respawning effect, and I don’t remember why (I suposse it was because an error that showed) deleted a water script
That obviously gave me a big error, so after hours of trying things, figured how to reimport that script.
But now I have this error:
Assets/Standard Assets/Effects/ImageEffects/Editor/Water (Pro Only)/WaterBaseEditor.cs(8,13): error CS0246: The type or namespace name `WaterBase' could not be found. Are you missing `UnityStandardAssets.Water' using directive?
I was very happy with the results, but now I'm stuck here and I'm not able to find a solution (Spent days searching on the internet, but 0 luck)
And the waterbase files are on their places, I don't get it.
Can somebody help me please?
Here's the part of the code where the problem is supossed to be:
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(WaterBase))]
public class WaterBaseEditor : Editor
{
public GameObject oceanBase;
private WaterBase waterBase;
private Material oceanMaterial = null;
private SerializedObject serObj;
private SerializedProperty sharedMaterial;
public SerializedProperty waterQuality;
public SerializedProperty edgeBlend;
public void OnEnable ()
{
serObj = new SerializedObject (target);
sharedMaterial = serObj.FindProperty("sharedMaterial");
waterQuality = serObj.FindProperty("waterQuality");
edgeBlend = serObj.FindProperty("edgeBlend");
}
public override void OnInspectorGUI ()
{
serObj.Update();
waterBase = (WaterBase)serObj.targetObject;
oceanBase = ((WaterBase)serObj.targetObject).gameObject;
if(!oceanBase)
return;
GUILayout.Label ("This script helps adjusting water material properties", EditorStyles.miniBoldLabel);
EditorGUILayout.PropertyField(sharedMaterial, new GUIContent("Material"));
oceanMaterial = (Material)sharedMaterial.objectReferenceValue;
if (!oceanMaterial) {
sharedMaterial.objectReferenceValue = (Object)WaterEditorUtility.LocateValidWaterMaterial(oceanBase.transform);
serObj.ApplyModifiedProperties();
oceanMaterial = (Material)sharedMaterial.objectReferenceValue;
if (!oceanMaterial)
return;
}
↧