/// <summary>
        /// Evaluate the current condition
        /// </summary>
        /// <returns></returns>
        public override bool EvaluateCondition(MonoBehaviour monoBehaviour)
        {
            var gameItem = GameItem;

            if (gameItem)
            {
                return(GameConditionHelper.CompareNumbers(GameItem.Score, Comparison, Value));
            }
            return(false);
        }
        /// <summary>
        /// Evaluate the current condition
        /// </summary>
        /// <returns></returns>
        public override bool Evaluate()
        {
            var gameItem = GameItem;

            if (gameItem)
            {
                return(GameConditionHelper.CompareNumbers(GameItem.Coins, Comparison, Value));
            }
            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Evaluate the current condition
        /// </summary>
        /// <returns></returns>
        public override bool EvaluateCondition(MonoBehaviour monoBehaviour)
        {
            var gameItem = GameItem;

            if (gameItem)
            {
                var counterReference = GameItem.GetCounter(Counter);
                Assert.IsNotNull(counterReference, string.Format("The specified Counter '{0}' was not found. Check that is exists in the game configuration.", Counter));
                if (counterReference.Configuration.CounterType == ObjectModel.CounterConfiguration.CounterTypeEnum.Int)
                {
                    return(GameConditionHelper.CompareNumbers(counterReference.IntAmount, Comparison, IntAmount));
                }
                else
                {
                    return(GameConditionHelper.CompareNumbers(counterReference.FloatAmount, Comparison, FloatAmount));
                }
            }
            return(false);
        }
 /// <summary>
 /// Evaluate the current condition
 /// </summary>
 /// <returns></returns>
 public override bool Evaluate()
 {
     Assert.IsTrue(GameManager.IsActive, "To use the Game Stars Total Condition, ensure that you have a GameManager added to your scene.");
     return(GameConditionHelper.CompareNumbers(GameManager.Instance.StarsTotal, Comparison, Value));
 }
 /// <summary>
 /// Evaluate the current condition
 /// </summary>
 /// <returns></returns>
 public override bool Evaluate()
 {
     Assert.IsTrue(GameManager.IsActive, "To use the Player Score Condition, ensure that you have a GameManager added to your scene.");
     Assert.IsNotNull(GameManager.Instance.Players, "To use the Player Score Game Condition, ensure that you have configured Players to be setup in your scene.");
     return(GameConditionHelper.CompareNumbers(GameManager.Instance.Players.Selected.Score, Comparison, Value));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Evaluate the current condition
 /// </summary>
 /// <returns></returns>
 public override bool EvaluateCondition(MonoBehaviour monoBehaviour)
 {
     Assert.IsTrue(GameManager.IsActive, "To use the Level Coins Condition, ensure that you have a GameManager added to your scene.");
     Assert.IsNotNull(GameManager.Instance.Levels, "To use the Level Coins Game Condition, ensure that you have configured Levels to be setup in your scene.");
     return(GameConditionHelper.CompareNumbers(GameManager.Instance.Levels.Selected.Coins, Comparison, Value));
 }