Пример #1
0
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Arrow"))
     {
         isInBox      = false;
         currentArrow = null;
         typeArrow    = TypeArrow.NONE;
     }
 }
Пример #2
0
 public Key(TypeArrow _direction, float _tempo, bool _visible, bool _isRandom, bool _isSpecial, int _damage = 1)
 {
     this.direction = _direction;
     this.tempo     = _tempo;
     this.visible   = _visible;
     this.isRandom  = _isRandom;
     this.isSpecial = _isSpecial;
     this.damage    = _damage;
 }
Пример #3
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Arrow"))
     {
         isInBox      = true;
         currentArrow = other.GetComponent <ArrowControl>();
         typeArrow    = currentArrow.typeArrow;
     }
 }
Пример #4
0
        public GameObject AssignSprite()
        {
            GameObject gObj = null;

            if (isRandom)
            {
                direction = (TypeArrow)Random.Range(1, 5);
            }

            if (!isSpecial)
            {
                switch (direction)
                {
                case TypeArrow.UP:
                    gObj = Spawner.Instance.arrowObj[0];
                    break;

                case TypeArrow.DOWN:
                    gObj = Spawner.Instance.arrowObj[1];
                    break;

                case TypeArrow.RIGHT:
                    gObj = Spawner.Instance.arrowObj[2];
                    break;

                case TypeArrow.LEFT:
                    gObj = Spawner.Instance.arrowObj[3];
                    break;
                }
            }
            else
            {
                switch (direction)
                {
                case TypeArrow.UP:
                    gObj = Spawner.Instance.arrowObjS[0];
                    break;

                case TypeArrow.DOWN:
                    gObj = Spawner.Instance.arrowObjS[1];
                    break;

                case TypeArrow.RIGHT:
                    gObj = Spawner.Instance.arrowObjS[2];
                    break;

                case TypeArrow.LEFT:
                    gObj = Spawner.Instance.arrowObjS[3];
                    break;
                }
            }
            return(gObj);
        }
Пример #5
0
 public static IType TypeMap(Func <int, TypeVar, IType> onVar, int c, IType t)
 {
     IType Walk(int c, IType t)
     {
         return(t switch
         {
             TypeVar v => onVar(c, v),
             TypeId i => i,
             TypeString ts => ts,
             TypeUnit u => u,
             TypeRecord r => new TypeRecord(r.Variants.Select(p => (p.Item1, Walk(c, p.Item2)))),
             TypeFloat f => f,
             TypeBool b => b,
             TypeNat n => n,
             TypeArrow a => new TypeArrow(Walk(c, a.From), Walk(c, a.To)),
             TypeVariant tv => new TypeVariant(tv.Variants.Select(p => (p.Item1, Walk(c, p.Item2)))),
             _ => throw new InvalidOperationException()
         });
     }