handzlikchris / Unity.MissingUnityEvents

Editor extension to generate events that are executed before property set, eg. Transform-position, Transform-rotation, Transform-parent which allows to write more event driven code or debug property changes that are not simple to track down. Easily customisable to allow adding events to different property setters / types.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't know why is not working :(

davidlehub opened this issue · comments

When i change the position, not thing happen ! Here is the my code:
`using System;
using UnityEngine;

namespace AssetsTest
{
class Class1 : MonoBehaviour
{
[SerializeField]
private Transform follow;

	//private void Awake()
	private void Start()
	{
		follow.SetPositionExecuting += Follow_SetPositionExecuting;
	}

	private void Follow_SetPositionExecuting(object sender, Vector3 e)
	{
		Debug.Log("020210207185411");
	}
}

}
`
Thanks in advance for any help

Hi David,

Looks like you got the setup right (otherwise you'd be getting compilation error that SetPositionExecuting) does not exist.

Rifht now this is standard c# event, there's preatty much nothing that could go wrong in there.
Probably best to take a step back and confirm that the position is actually being set? and it's also actually being set by .position setter and not some other way.

Just to test if the tool works you can adjust .position yourself from some other script and it needs to fire. Perhaps also attaching debugger and seeing the code line by line could help. Maybe there's some issue and your code actually did not compile hence is not executing?

Thanks,
Chris

Cool, glad I could help.