Пример #1
0
 public void JumpBeforBrianHit()
 {
     MessageSystemPlayingScene.IsJump = true;
     PlayerZone.SetNoneRigid();
     MessageSystemGameBlock.SetPlayingConstraints();
     if (!MessageSystemPlayingScene.exitFromPingPong)
     {
         MessageSystemPlayingScene.exitFromPingPong = true;
     }
     if (!MessageSystemPlayingScene.IsDead)
     {
         WaitingScreen.wait(MessageSystemPlayingScene.DisableCollider());
         MessageSystemPlayingScene.Player.GetComponent <Rigidbody2D>().AddForce(new Vector2(0, 9), ForceMode2D.Impulse);
     }
 }
 public static void Jump()
 {
     if (!StopCollider.IsCollision)
     {
         float powerJump = 10;
         isJump = true;
         PlayerZone.SetNoneRigid();
         MessageSystemGameBlock.SetPlayingConstraints();
         if (!exitFromPingPong)
         {
             exitFromPingPong = true;
             player.tag       = "Player";
         }
         if (!isDead)
         {
             WaitingScreen.wait(DisableCollider());
             player.GetComponent <Rigidbody2D>().AddForce(new Vector3(0, powerJump, 0), ForceMode2D.Impulse);
             player.GetComponent <Animator>().SetBool("IsJumpUp", true);
         }
     }
 }
    public static void SelectHero(GameObject hero)
    {
        foreach (GameObject obj in circle)
        {
            if (obj.name == hero.name)
            {
                obj.GetComponent <Animation>().Play("RizeCircle");
            }
            else if (playerName == obj.name)
            {
                obj.GetComponent <Animation>().Play("ReduceCircle");
                if (IsActiveColider(playerName))
                {
                    obj.GetComponentInChildren <BoxCollider2D>().enabled = true;
                }
                else
                {
                    ChangeToCrossSprite(obj);
                }
            }
            else
            {
                if (IsActiveColider(obj.name))
                {
                    obj.GetComponentInChildren <BoxCollider2D>().enabled = true;
                }
            }
        }
        playerName = hero.name;
        player.SetActive(false);
        Vector2 positionLastPlayer = player.transform.position;
        string  nameLastPlayer     = player.name;

        if (!isStart)
        {
            storageVoid[0, (int)hash[playerName]]();
        }
        else
        {
            ChangeHeroAfterStart();
        }
        if (IsStart && IsActiveColider(nameLastPlayer))
        {
            player.transform.position = positionLastPlayer;
        }
        if (player.transform.position.x >= 0)
        {
            PlayerZone.IsOutside = false;
            PlayerZone.SetNoneRigid();
        }
        if (PlayerZone.IsOutside && !isDead)
        {
            PlayerZone.MoveToPlayerZone();
        }
        if (isJump && !isDead)
        {
            MessageSystemGameBlock.SetPlayingConstraints();
        }
        if (!animationDeathIsFinished)
        {
            MessageSystemGameBlock.StartGame();
            isDead = false;
            EnableCollider();
        }
        DeadLine.IsDeadLine = false;
        player.SetActive(true);
    }