Ejemplo n.º 1
0
        /// <summary>
        /// Esegue il Setup dell'behaviour
        /// per aggiungere comportamenti custom sovrascrivere CustomSetup
        /// </summary>
        /// <param name="entity">entità a cui appartiene il behaviour</param>
        public void Setup(AbsEntity entity)
        {
            if (!hasBeenSetup)
            {
                this.entity  = entity;
                hasBeenSetup = true;
                CustomSetup();

                if (onSetup == null)
                {
                    onSetup = new UnityEvent();
                }

                onSetup?.Invoke();
            }
        }
Ejemplo n.º 2
0
        public static void SubscribeToStart(this AbsEntity entity, UnityAction action)
        {
            Start_Bh tmp = entity.GetOrAddBehaviour <Start_Bh>(true, entity.transform);

            tmp.onStart.AddListener(action);
        }
Ejemplo n.º 3
0
        public static void SubscribeToLateUpdate(this AbsEntity entity, UnityAction action)
        {
            LateUpdate_Bh tmp = entity.GetOrAddBehaviour <LateUpdate_Bh>(true, entity.transform);

            tmp.onLateUpdate.AddListener(action);
        }