Skip to content

[Watch] Add support for Properties and Methods #6

@mrbeardy

Description

@mrbeardy

Feature: Watch
Description: Allow the [Watch] Attribute to be used on Properties and Methods.
Why?: As well as increasing the amount of things that can be watched, allowing Properties and Methods to be read and invoked will remove the need to set temporary variables to Watch an inherited field.

Before

class Box : MonoBehaviour {
  [Watch] private Vector3 position;

  private void Update() {
    position = transform.position;
  }
}

After

class Box : MonoBehaviour {
  [Watch] private Vector3 Position => transform.position;
}

[Watch] on Method

class Box : MonoBehaviour {
  [Watch]
  private Quaternion GetRotation() {
    return transform.rotation;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions