protected virtual void Awake() { var idData = new EventActorComponentComputeID.Data(this); EventManager.TriggerEvent(new EventActorComponentComputeID(idData)); ID = idData.ID; #if UNITY_EDITOR if (!ID.IsValid) { Debug.Log("Apparently we could not get an actorID for a component, was there no factory?"); ActorFactory af = FindObjectOfType <ActorFactory>(); if (af != null) { ID = af.GetIDHackHackHack(this); } else { Debug.LogWarning("Oooh no! there is no ActorFactory in the scene!"); } } #endif }
private void Start() { var idData = new EventActorComponentComputeID.Data(this); EventManager.TriggerEvent(new EventActorComponentComputeID(idData)); ID = idData.ID; }