Example #1
0
        public override bool onDirection(Direction d)
        {
            GridLoc orGLoc = currentIndex.clone();

            try {
                moveSelect(d);
                return(false);
            } catch (Exception e) {
                if (getNextTVBehaviourByDirection(d) != null)
                {
                    currentIndex = orGLoc;
                    return(true);
                }
                else if (!DirectionF.i(d).isVertical() && horizontalEndRepeatable)
                {
                    handleRepeatEnd(d);
                    return(false);
                }
                else if (DirectionF.i(d).isVertical() && verticalEndRepeatable)
                {
                    handleRepeatEnd(d);
                    return(false);
                }
                else
                {
                    return(handleOther(d, orGLoc, currentIndex));
                }
            }
        }
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         lightSys.Light();
         PlayerController player = collision.gameObject.GetComponent <PlayerController>();
         player.BlockDirection(DirectionF.rotateDirection(player.direction, orientation));
         player.StopMovement();
         player.SetReady(1f);
         SoundManager.instance.PlaySingle(hitSound);
     }
 }