Beispiel #1
0
        /// <summary>
        /// Perform the action
        /// </summary>
        /// <returns></returns>
        protected override void Execute(bool isStart)
        {
            // use cached version unless target could be dynamic (TargetType.CollidingGameObject)
            var targetFinal = _cachedFinalTarget;

            if (targetFinal == null)
            {
                targetFinal = GameActionHelper.ResolveTargetComponent <Button>(TargetType, this, Target);
                if (TargetType != GameActionHelper.TargetType.CollidingGameObject)
                {
                    _cachedFinalTarget = targetFinal;
                }
            }

            Assert.IsNotNull(targetFinal,
                             "Ensure that you specify a Target button when using the 'Set Button Interactable' action.");

            targetFinal.interactable = Interactable;
            if (AnimateChanges)
            {
                Debug.LogWarning("Animation of Button Interactable State changes is only supported if using the Beautiful Transitions asset. See the Menu | Window | Game Framework | Integrations Window for more information.");
#if BEAUTIFUL_TRANSITIONS
                BeautifulTransitions.Scripts.DisplayItem.DisplayItemHelper.SetActiveAnimated(Owner, targetFinal.gameObject, Interactable);
#else
#endif
            }
        }
        /// <summary>
        /// Perform the action
        /// </summary>
        /// <returns></returns>
        protected override void Execute(bool isStart)
        {
            // use cached version unless target could be dynamic (TargetType.CollidingGameObject)
            var transformFinal = GameActionHelper.ResolveTargetComponent <Transform>(LocationTargetType, this, Location);

            if (transformFinal == null)
            {
                Debug.LogWarningFormat("No Target Location is specified for the action {0} on {1}", GetType().Name, Owner.gameObject.name);
            }
            if (Prefab != null && transformFinal != null)
            {
                Instantiate(Prefab, transformFinal.position, transformFinal.rotation);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Perform the action
        /// </summary>
        /// <returns></returns>
        protected override void Execute(bool isStart)
        {
#if PRO_POOLING
            if (!string.IsNullOrEmpty(PoolName))
            {
                // use cached version unless target could be dynamic (TargetType.CollidingGameObject)
                var transformFinal = GameActionHelper.ResolveTargetComponent <Transform>(LocationTargetType, this, Location);
                if (transformFinal == null)
                {
                    Debug.LogWarningFormat("No Target Location is specified for the action {0} on {1}", GetType().Name, Owner.gameObject.name);
                }
                if (transformFinal != null)
                {
                    global::ProPooling.Components.GlobalPools.Instance.Spawn(PoolName,
                                                                             transformFinal.position,
                                                                             transformFinal.rotation);
                }
            }
#endif
        }
        /// <summary>
        /// Perform the action
        /// </summary>
        /// <returns></returns>
        protected override void Execute(bool isStart)
        {
            // use cached version unless target could be dynamic (TargetType.CollidingGameObject)
            var targetFinal = _cachedFinalTarget;

            if (targetFinal == null)
            {
                targetFinal = GameActionHelper.ResolveTargetComponent <TransitionBase>(TargetType, this, Target);
                if (TargetType != GameActionHelper.TargetType.CollidingGameObject)
                {
                    _cachedFinalTarget = targetFinal;
                }
            }

            if (targetFinal == null)
            {
                Debug.LogWarningFormat("No Target is specified for the action {0} on {1}", GetType().Name, Owner.gameObject.name);
            }
            if (targetFinal != null)
            {
                targetFinal.TransitionOut();
            }
        }