コード例 #1
0
        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
        }
コード例 #2
0
        private void Start()
        {
            var idData = new EventActorComponentComputeID.Data(this);

            EventManager.TriggerEvent(new EventActorComponentComputeID(idData));
            ID = idData.ID;
        }