示例#1
0
 public static SelectMove GetInstance()
 {
     if (_instance == null)
     {
         _instance = new SelectMove();
     }
     return(_instance);
 }
示例#2
0
    public void OnPointerDownTL()
    {
        deltaMove = Input.mousePosition;
        selectMove = SelectMove.TL;
        TL.color = selectedColor;

        RectTransform aRt = area.GetComponent<RectTransform>();
        aRt.anchorMin = new Vector2(1, 0);
        aRt.anchorMax = new Vector2(1, 0);
        aRt.pivot = new Vector2(0.5f, 0.5f);
        Vector3 pos = aRt.anchoredPosition;
        aRt.anchoredPosition = new Vector3 (Mathf.Abs (pos.x) * -1, Mathf.Abs (pos.y), pos.z);
    }
示例#3
0
        public Battle(Pokemon playerPokemon, Pokemon opponentPokemon)
        {
            this.playerPokemon   = playerPokemon;
            this.opponentPokemon = opponentPokemon;

            combatText       = new CombatTextManager(this);
            animationManager = new AnimationManager(this);
            intro            = new Intro(this);
            selectAction     = new SelectAction(this);
            selectMove       = new SelectMove(this);
            changeAction     = new ChangeTurn(this);
            end          = new End(this);
            playerTurn   = new PlayerTurn(this);
            opponentTurn = new OpponentTurn(this);
            curentState  = intro;
        }
示例#4
0
 void Update()
 {
     for (int i = 0; i < icons.Length; i++)
     {
         if (Input.GetButtonDown("Select" + (i + 1)) && !created[i])
         {
             //if the player hits the jump button let them join the game by spwning a cursor
             GameObject newCursor = Instantiate(CursorPerfab) as GameObject;
             SelectMove sMove     = newCursor.GetComponent <SelectMove>();      //get a reference to the SelectMove script
             sMove.playerNum = i + 1;                                           //assign a player number
             sMove.icons     = icons;                                           // give the new cursor a referance to the icon locations
             newCursor.GetComponent <SpriteRenderer>().color = cursorColors[i]; // set the cursor color
             created[i] = true;                                                 // mark that the cursor was created
         }
     }
 }
示例#5
0
 private static void InitMap()
 {
     _map[AttackManager.GetInstance().PhaseName] = SelectAttack.GetInstance();
     _map[MoveManager.GetInstance().PhaseName]   = SelectMove.GetInstance();
 }
示例#6
0
        public void PanzerAction()
        {
            #region SelectActionPanzer
            switch (Select)
            {
                case SelectMove.Move:
                    #region Move
                    if (StabilityAngles(10))
                    {

                        #region MovePazer90
                        if (Angles.z == 90)
                        {


                            Move();
                            #region PointEnd
                            if (Position.y <= PointEnd)
                            {
                                // 
                                GameParam.LifeSMG -= 1;
                                Destroy(Panzer);
                            }
                            #endregion
                        }
                        else
                        #endregion
                            #region MovePanzer180
                            if (Angles.z == 180)
                            {
                                if (Move(CountMoveDown))
                                {
                                    CountMoveDown = constCountMoveDown;
                                    Select = SelectMove.Left;
                                }
                                else
                                {
                                    CountMoveDown--;
                                }
                            }

                            else
                            #endregion
                                #region MovePanzer0
                                if (Angles.z == 0)
                                {

                                    if (Move(CountMoveDown))
                                    {
                                        CountMoveDown = constCountMoveDown;
                                        Select = SelectMove.Right;
                                    }
                                    else
                                    {
                                        CountMoveDown--;
                                    }
                                }
                                else
                                #endregion
                                    #region MovePanzer270
                                    if (Angles.z == 0)
                                    {
                                        if (Move(CountMoveDown))
                                        {
                                            CountMoveDown = constCountMoveDown;
                                            Select = SelectMove.Left;
                                            CountRotation = 16;
                                        }
                                        else
                                        {
                                            CountMoveDown--;
                                        }
                                    }

                                    #endregion
                    }
                    #endregion
                    break;
                case SelectMove.Right:
                    #region RightRotation
                    if (RotateRight(10, CountRotation))
                    {
                        CountRotation = constCountRotation;
                        Select = 0;
                    }
                    else
                    {
                        CountRotation--;
                    }
                    #endregion
                    break;
                case SelectMove.Left:
                    #region LeftRotation
                    if (RotateLeft(10, CountRotation))
                    {
                        CountRotation = constCountRotation;
                        Select = 0;
                    }
                    else
                    {
                        CountRotation--;
                    }
                    #endregion
                    break;
                case SelectMove.Around:


                    break;
            }
            #endregion
        }
示例#7
0
 public void OnPointerDownArea()
 {
     selectMove = SelectMove.Area;
     offset = Input.mousePosition - transform.position;
 }
示例#8
0
 public void OnPointerUp()
 {
     selectMove = SelectMove.None;
     BL.color = normalColor;
     BR.color = normalColor;
     TL.color = normalColor;
     TR.color = normalColor;
     /*Debug.Log ("ScreenW: " + Screen.width + " ScreenH: " + Screen.height);
     Debug.Log ("Pos: " + transform.position + " pos2: " + transform.rect.position);
     Debug.Log ("xMin: " + transform.rect.xMin + " xMax: " + transform.rect.xMax);
     Debug.Log ("yMin: " + transform.rect.yMin + " yMax: " + transform.rect.yMax);
     Debug.Log ("Pos: "+ (transform.position.x + transform.rect.xMin)+", "+(transform.position.y + transform.rect.yMax)+" width: "+transform.rect.width+" height: "+transform.rect.height);*/
 }