Esempio n. 1
0
    public void BeginPeriodic(PeriodicType type, float period = .15f)
    {
        DOTweenUtils.KillTween(ref currentPeriodicTween);
        switch (type)
        {
        case PeriodicType.VERY_LIGHT:
            VibrateSelectionChange();
            break;

        case PeriodicType.MEDIUM:
            VibrateMedium();
            break;

        case PeriodicType.HEAVY:
            VibrateHeavy();
            break;

        case PeriodicType.LIGHT:
        default:
            VibrateLight();
            break;
        }
        DOTweenUtils.KillTween(ref currentPeriodicTween);
        currentPeriodicTween = DOVirtual.DelayedCall(period, () =>
        {
            BeginPeriodic(type, period);
        });
    }
 public override void Init(Irony.Parsing.ParsingContext context, Irony.Parsing.ParseTreeNode treeNode)
 {
     base.Init(context, treeNode);
     Value = treeNode.FirstChild.AstNode as Constant;
     string periodType = treeNode.ChildNodes[1].FindTokenAndGetText().ToLower();
     switch (periodType)
     {
         case "month":
         case "months": PeriodicType = MetaModel.PeriodicType.Month; break;
         case "days" :
         case "day": PeriodicType = MetaModel.PeriodicType.Day; break;
         default:
             throw new ArgumentException("Unregconized period type:" + periodType);
     }
 }
 public PeriodicTimeDefinition(Expression length, PeriodicType periodicType)
 {
     _lengthExpr = length;
     _periodicType = periodicType;
 }
 public PeriodicTimeDefinition(int length, PeriodicType periodicType)
 {
     _length = length;
     _periodicType = periodicType;
 }