コード例 #1
0
        public string GetMessage(int targetNumber, int?x)
        {
            var messageFormat = Message;

            if (messageFormat == null)
            {
                messageFormat = MaxCount != null && MaxCount.GetValue(x) == 1
          ? DefaultMessageOneTarget
          : DefaultMessageMultipleTargets;
            }

            if (_owningCard != null)
            {
                messageFormat = String.Format("{0}: {1}", _owningCard, messageFormat);
            }

            if (MaxCount != null)
            {
                var maxNumber = MinCount.GetValue(x) == MaxCount.GetValue(x)
          ? MaxCount.GetValue(x).ToString()
          : "max. " + MaxCount.GetValue(x);

                return(string.Format(messageFormat, targetNumber, maxNumber));
            }

            return(string.Format(messageFormat, targetNumber));
        }
コード例 #2
0
        private void Update(EvaluationContext context)
        {
            if (MaxCount.DirtyFlag.IsDirty)
            {
                int maxCount = MaxCount.GetValue(context);
                ParticleSystem.Value.MaxCount = maxCount;
                ParticleSystem.Value.Init();
            }

            if (MaxEmitRatePerFrame.DirtyFlag.IsDirty)
            {
                MaxEmitRatePerFrame.GetValue(context);
            }
            Log.Info("particle system setup updated");
        }
コード例 #3
0
        private void Update(EvaluationContext context)
        {
            if (MaxCount.DirtyFlag.IsDirty)
            {
                int maxCount = MaxCount.GetValue(context);
                Count.Value = maxCount;
                DeadListInitDispatch.Value = new Int3(maxCount / 64, 1, 1);
                UpdateDispatch.Value       = new Int3(maxCount / 64, 1, 1);
            }

            if (MaxEmitRatePerFrame.DirtyFlag.IsDirty)
            {
                EmitDispatch.Value = new Int3(MaxEmitRatePerFrame.GetValue(context), 1, 1);
            }
            Log.Info("constants updated");
        }