Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 /
avatar image
0
Question by lermy3d · Jul 10, 2015 at 10:40 AM · errorcompiler errorcompiler bug

Override BaseVertexEffect error when building for WebGL

Hello guys!

I am receiving an error compiling to WebGL when overriding a method already overridden by parent class. You can follow the next steps to reproduce:

1 - Inheriting from class BaseVertexEffect, inside namespace UnityEngine.UI.

2 - Override the method OnValidate, like: protected override void OnValidate().

3 - Build for WebGL.

You will get next error log: 'ChildClass.OnValidate()' is marked as an override but no suitable method found to override'

The compiler should find the method from the parent classes and it should be able to override it. this is probably happening for all classes where this case apply.

I already file a bug report to the Unity team but without avail, I havent't heard from them... :(

Comment
Add comment
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 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by oddgoo · Jul 31, 2015 at 01:25 AM

This seems to be a Unity bug, but I found an easy workaround:

Simply wrap the OnValidate method with the "#if UNITY_EDITOR" directive, like so:

 #if UNITY_EDITOR
         protected override void OnValidate ()
         {
             base.OnValidate ();
         }
 #endif

OnValidate is an Editor-only method, so it shouldn't cause any issues with your build :),

let me know if it works!

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 lermy3d · Jul 31, 2015 at 09:12 PM 0
Share

It worked! Thanks a lot oddgoo!!

That is so weird, because as you know OnValidate method is in the $$anonymous$$onoBehaviour class. (check here)

They should be checking this when compiling, unless the unity $$anonymous$$m does not have a way to do is, otherwise is definitely a bug.

Thanks again! Greatly appreciate your help! :) Best regards, Lermy

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can't add script to gameobject even though there are no compiler errors in the script and the class name matches the script name 1 Answer

Unity keeps asking about safe mode on load? 2 Answers

BCE0018: 'MovieTexture' does not denote a valid type ('not found'). 1 Answer

Why is this error coming up in my code ? 1 Answer

Compiler errors when opening unity 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