Example #1
0
    IEnumerator Slip()
    {
        yield return(new WaitForEndOfFrame());

        MessageSystemPlayingScene.Slip();
        DisableScreen();
    }
Example #2
0
    private void Start()
    {
        isPressed = 0;

        img     = GetComponent <Image>();
        play[0] = () =>
        {
            if (lastPlay != null)
            {
                lastPlay.GetComponent <Image>().sprite = sprite[0];
                lastPlay.GetComponent <PlayOnMusicPanel>().isPressed = 0;
            }
            img.sprite = sprite[1];
            MessageSystemPlayingScene.PlayClip(clip);
            lastPlay  = gameObject;
            isPressed = 1;
        };
        play[1] = () =>
        {
            img.sprite = sprite[0];
            MessageSystemPlayingScene.StopClip();
            isPressed = 0;
            lastPlay  = null;
        };
    }
Example #3
0
 private void OnMouseUp()
 {
     anim.Play("GoAway");
     if (!MessageSystemPlayingScene.IsStart)
     {
         menuPanel.SetActive(false);
         MessageSystemPlayingScene.StartGame();
         if (Conecting.Management == 0)
         {
             screen.SetActive(true);
         }
         else
         {
             StartCoroutine(EnButtons());
         }
         MessageSystemGameBlock.DisableAllBlock();
         Score.increeze();
     }
     else
     {
         MessageSystemGameBlock.StartAfterHit();
         MessageSystemPlayingScene.Player.GetComponent <Animator>().speed = 1;
         EnableButtons();
     }
     if (PlayerPrefs.HasKey("FirstStart"))
     {
         PauseGame.IsPause = false;
         pause.SetActive(true);
     }
     else
     {
         FirstStart.SetActiveStopCollider(true);
     }
     source.Play();
 }
Example #4
0
 public static void DeathAfterDeadLine()
 {
     MessageSystemPlayingScene.GeneralyPartOfDeath();
     MessageSystemPlayingScene.AutoSelectNextCharacter();
     MessageSystemGameBlock.StartGame();
     MessageSystemPlayingScene.InBodyColider = false;
 }
Example #5
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject obj = collision.gameObject;

        if (PlayerZone.IsOutside && !MessageSystemPlayingScene.Player.CompareTag("InVisible") && !MessageSystemPlayingScene.IsDead)
        {
            PlayerZone.MoveToPlayerZone();
        }
        if ((obj.CompareTag("Player") || (obj.CompareTag("Hit") && obj.name == "Brian")) && MessageSystemPlayingScene.IsJump)
        {
            MessageSystemPlayingScene.exitFromPingPong = false;
            if (!PlayerZone.IsOutside)
            {
                MessageSystemPlayingScene.SetDefaultConstraints();
            }
            else
            {
                MessageSystemGameBlock.SetPlayingConstraints();
            }
            if (Conecting.Management == 0 && !TapToGo.Screen.activeInHierarchy)
            {
                TapToGo.Screen.SetActive(true);
            }
            MessageSystemPlayingScene.IsJump = false;
            MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsRunAgain", true);
            StartCoroutine(PreparationToJump());
        }
    }
Example #6
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !isOne)
     {
         isOne = true;
         MessageSystemPlayingScene.speedy();
     }
 }
Example #7
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !isOne)
     {
         isOne = true;
         MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsDefaultDeath", true);
         MessageSystemPlayingScene.GeneralyPartOfDeath();
     }
 }
Example #8
0
    IEnumerator PreparationToJump()
    {
        MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsJumpUp", false);
        MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsJumpDown", false);
        yield return(new WaitForSeconds(0.4f));

        MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsRunAgain", false);
        MessageSystemPlayingScene.EnableCollider();
    }
Example #9
0
    IEnumerator Death()
    {
        yield return(new WaitForSeconds(0.4f));

        MessageSystemPlayingScene.AutoSelectNextCharacter();
        yield return(new WaitForSeconds(0.1f));

        MessageSystemPlayingScene.InBodyColider = false;
    }
Example #10
0
 private void OnCollisionStay2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player") || collision.gameObject.CompareTag("Hit"))
     {
         if (collision.gameObject.name == tag && !MessageSystemPlayingScene.IsJump)
         {
             MessageSystemPlayingScene.SetDefaultConstraints();
         }
     }
 }
Example #11
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !robotScript.IsOne)
     {
         robotScript.IsOne = true;
         robDead.Death();
         MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsDeath", true);
         MessageSystemPlayingScene.GeneralyPartOfDeath();
     }
 }
Example #12
0
 private void OnMouseDown()
 {
     if (!StopCollider.IsCollision)
     {
         if (!MessageSystemPlayingScene.IsDead)
         {
             WaitingScreen.wait(MessageSystemPlayingScene.DisableCollider());
         }
         transform.localScale = new Vector3(changeScale, changeScale, 1);
     }
 }
Example #13
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !isDeadLine)
     {
         isDeadLine = true;
         MessageSystemPlayingScene.GeneralyPartOfDeath();
         MessageSystemPlayingScene.AutoSelectNextCharacter();
         MessageSystemGameBlock.StartGame();
         MessageSystemPlayingScene.InBodyColider = false;
     }
 }
Example #14
0
 public void ExitFromTeleport()
 {
     if (!PlayerZone.IsOutside)
     {
         MessageSystemPlayingScene.SetDefaultConstraints();
     }
     else
     {
         MessageSystemGameBlock.SetPlayingConstraints();
     }
     MessageSystemPlayingScene.Player.tag = "Player";
 }
Example #15
0
    private void OnMouseUp()
    {
        upPosition = Input.mousePosition;

        if (downPosition == upPosition)// Hit
        {
            MessageSystemPlayingScene.Hit();
            isSwipe = false;
            DisableScreen();
        }
        isSwipe = false;
    }
Example #16
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if ((collision.gameObject.CompareTag("Player") || collision.gameObject.CompareTag("Hit")) && collision.gameObject.activeInHierarchy)
     {
         if (collision.gameObject.name != tag && !isOne)
         {
             isOne = true;
             MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsDeath", true);
             MessageSystemPlayingScene.GeneralyPartOfDeath();
         }
     }
 }
Example #17
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !isOne)
     {
         isOne = true;
         GameObject player = MessageSystemPlayingScene.Player;
         player.GetComponent <Rigidbody2D>().AddForce(new Vector2(1.5f, 0), ForceMode2D.Impulse);
         player.GetComponent <Animator>().SetBool("IsFall", true);
         MessageSystemPlayingScene.GeneralyPartOfDeath();
         StartCoroutine(Death());
     }
 }
Example #18
0
 private void OnMouseDown()
 {
     if (!MessageSystemPlayingScene.IsStart)
     {
         Hint.PlayClip();
     }
     if (!StopCollider.IsCollision)
     {
         InstantiateSpeed(gameObject.name);
         MessageSystemPlayingScene.SelectHero(gameObject);
     }
 }
Example #19
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.layer == 10 && !isOne)
     {
         isOne = true;
         MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsDeath", true);
         MessageSystemPlayingScene.GeneralyPartOfDeath();
     }
     if (collision.gameObject.layer == 9 && !isOne)
     {
         GetComponent <CircleCollider2D>().enabled = false;
     }
 }
Example #20
0
 public static void Resume()
 {
     MessageSystemPlayingScene.EnableCollider();
     StopCollider.IsCollision        = false;
     MessageSystemPlayingScene.IsHit = false;
     MessageSystemGameBlock.StartAfterHit();
     MessageSystemPlayingScene.Player.GetComponent <Animator>().speed = 1;
     StopCollider.RestoreConstraints();
     StopCollider.PlayAnimation();
     StopCollider.SetDefaultSortingLayer();
     StopCollider.SetActiveImageButtons(false);
     panel.SetActive(false);
 }
Example #21
0
    IEnumerator Teleport(float deltaX)
    {
        yield return(new WaitForEndOfFrame());

        if (deltaX < 0)//Teleport
        {
            MessageSystemPlayingScene.Teleport();
            if (!MessageSystemPlayingScene.IsTeleport)
            {
                DisableScreen();
            }
        }
    }
Example #22
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);
     }
 }
Example #23
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !MessageSystemPlayingScene.IsJump)
     {
         if (!PlayerZone.IsOutside)
         {
             MessageSystemPlayingScene.SetDefaultConstraints();
         }
         else
         {
             MessageSystemGameBlock.SetPlayingConstraints();
         }
         MessageSystemPlayingScene.SetVisibleImagePlayer(true);
         MessageSystemPlayingScene.InBodyColider = false;
     }
 }
Example #24
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        string name = collision.gameObject.name;

        if (hashtable.ContainsKey(name))
        {
            GameObject obj = collision.gameObject;
            StopGame();
            sortingLayerObj = null;

            MessageSystemPlayingScene.EnableCollider();
            SaveConstraints();
            MessageSystemPlayingScene.Player.GetComponent <Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeAll;
            panel.SetActive(true);
            isCollision = true;
            education[(int)hashtable[obj.name]](obj);
            hashtable.Remove(name);
        }
    }
Example #25
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (PlayerZone.IsOutside)
     {
         PlayerZone.MoveToPlayerZone();
     }
     if (collision.gameObject.CompareTag("Player") && MessageSystemPlayingScene.IsJump && !Cube.IsCollision)
     {
         MessageSystemPlayingScene.exitFromPingPong = false;
         if (!PlayerZone.IsOutside)
         {
             MessageSystemPlayingScene.SetDefaultConstraints();
         }
         else
         {
             MessageSystemGameBlock.SetPlayingConstraints();
         }
         MessageSystemPlayingScene.IsJump = false;
         MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsRunAgain", true);
         StartCoroutine(PreparationToJump());
     }
 }
Example #26
0
 public void Death()
 {
     MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsDefaultDeath", true);
     MessageSystemPlayingScene.GeneralyPartOfDeath();
 }
Example #27
0
 public void EnterToTeleport()
 {
     MessageSystemPlayingScene.Player.tag = "InVisible";
     MessageSystemPlayingScene.SetDefaultConstraints();
 }
Example #28
0
 private void OnMouseUp()
 {
     transform.localScale = new Vector3(defaultSize, defaultSize, 1);
     MessageSystemPlayingScene.SetDefaultVal();
     SceneManager.LoadScene(1);
 }
Example #29
0
 public void EnCol()
 {
     MessageSystemPlayingScene.EnableCollider();
 }
Example #30
0
 public void DisCol()
 {
     WaitingScreen.wait(MessageSystemPlayingScene.DisableCollider());
 }