JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

RFC: Live templates #69

Open citizenmatt opened 7 years ago

citizenmatt commented 7 years ago

I'm after suggestions for adding live/file/surround templates. I've come up with:

And er, that's it.

What else would be useful? What common code snippets would you reuse? GetComponent, InitializeOnLoadAttribute?

Silentor commented 7 years ago

Debug.Log(""); Debug.LogFormat("", ); and warning, error variants

sindrijo commented 7 years ago

cpropg - lazy initialized component property in MonoBehavior, I use this a lot...

private Component component;
public Component Component
{
    get
    {
        if (component == null)
        {
            component = GetComponent<Component>();
        }
        return component;
    }
}

sf - create a private field with [SerializeField] attribute.