Esempio n. 1
0
        public override void CheckWay(float _wayX, float _wayY)
        {
            Vector2 animatorWay = new Vector2(_wayX, _wayY).normalized;
            Vector2 pivotWay    = new Vector2(0.0f, 1.0f).normalized;
            float   degree      = Vector2.Angle(animatorWay, pivotWay);

            if (animatorWay.x < 0.0f)
            {
                if (degree < 45.0f)
                {
                    this.way = FOUR_WAY_TYPE.UP_LEFT;
                }
                else
                {
                    this.way = FOUR_WAY_TYPE.DOWN_LEFT;
                }
            }
            else
            {
                if (degree < 45.0f)
                {
                    this.way = FOUR_WAY_TYPE.UP_RIGHT;
                }
                else
                {
                    this.way = FOUR_WAY_TYPE.DOWN_RIGHT;
                }
            }
            this.shadow.transform.localPosition = this.posArr[(int)this.way];
        }
Esempio n. 2
0
 public FourWayShadowChecker(ShadowController _shadow, Vector2[] _posArr)
     : base(_shadow, _posArr)
 {
     this.type = SHADOW_TYPE.FOUR_WAY;
     this.way  = FOUR_WAY_TYPE.END;
 }