0

I'm working with C# and Visual Studio for Unity scripts and couldn't find a working solution to auto-implement methods. When I hover over the interface, it just shows the description. I found online about smart tag and then implement interface, but it doesn't appear with CTRL + . or SHIFT + ALT + F10

Is there a new way of doing this in this Visual Studio version, or maybe some option I need to check?

Jeff Mercado
  • 129,526
  • 32
  • 251
  • 272
Juan Carlos
  • 367
  • 2
  • 8
  • 16
  • 2
    Monobehaviour is a base class not an interface – R Quijano May 28 '17 at 16:27
  • My bad, however I still just want to override its methods, without having to write them by hand. – Juan Carlos May 28 '17 at 16:31
  • 2
    Within the body of the class (and not a method), you could just type `override` and it will give you a list of methods you could override. – Jeff Mercado May 28 '17 at 16:33
  • with override it partially works. It shows only Object methods Equals, GetHashCode and ToString. What if I would generate MonoBehaviour.OnCollisionEnter(Collision) method for example? – Juan Carlos May 28 '17 at 16:40
  • It should show you all members that are overridable for the class, not just `object` members. If your class is a descendant of `MonoBehavior` and `OnCollisionEnter` is indeed an overridable method, then it should appear in that list. When you choose an item in that list, a skeleton will be inserted for you which simply calls the base implementation. If that doesn't work, it should work with `Ctrl + Space` as well. Using that, it will show you all members you have access to in that context. `Ctrl + Space` should be your best friend. – Jeff Mercado May 28 '17 at 16:44
  • Unfortunately it only shows Object methods: http://imgur.com/a/mCyaL – Juan Carlos May 28 '17 at 16:47

0 Answers0