Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by AtanoKSi · Jan 22, 2017 at 05:57 PM · scripting problemerror message

How do I fix this WaterBase error?

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;
         }




Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FeoGarra · Sep 03, 2018 at 10:10 AM 0
Share

$$anonymous$$ake sure that you also import the "Water" sub-folder from the "Environment" folder of the Standard assets

8 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by sdclark79 · Jul 23, 2018 at 11:33 PM

Adding "using UnityStandardAssets.Water" will not work, the namespace is already referencing that. RodBeta2 has the right link, but it doesn't spell anything out. My solution, based on RobBeta2s link was to move the whole Editor folder out of StandardAssets and make it a top-level directory (Assets -> Editor).

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DarkGate · Sep 28, 2018 at 04:11 AM 0
Share

This worked for me, thanks!

avatar image LtKelleyUSMC · Dec 17, 2018 at 05:30 PM 0
Share

Yep, this worked for me too, by moving the Editor folder into the Assets folder.

avatar image keaton_burnett · Dec 30, 2021 at 12:01 AM 0
Share

worked for me to, not sure why but it did

avatar image
4

Answer by FeoGarra · Sep 03, 2018 at 10:11 AM

Make sure that you also import the "Water" sub-folder from the "Environment" folder of the Standard assets

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Taliessin · Nov 20, 2018 at 04:33 PM 0
Share

This worked for me, thank you.

avatar image
2

Answer by RodBeta2 · Oct 01, 2017 at 04:50 PM

I have the same problem today.

Refer to https://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html

You can move the dictionary "Assets\Malbers Animations" (Which contains WaterBase class) to "Assets\Standard Assets\Malbers Animations"

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Nelson96 · Jul 30, 2017 at 04:49 PM

If you are still having this problem, I fixed mine by adding using UnityStandardAssets.Water;

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by JustThommie · Sep 26, 2017 at 11:44 AM

I have the same problem, but its not working with ''using UnityStandardAssets.Water;''.

Can you help me.

Thanks

Greetings,

Thomas

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

122 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Help with Error Code CS0019 2 Answers

Hi! I am trying to use SceneManagement, but I keep getting errors. 1 Answer

Object reference not set to an instance of an object (c#) 0 Answers

ERROR Loading Script! WHAT'S WRONG?? 2 Answers

Getting error on lap counter script JS 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges