コード例 #1
0
        private void InputJump()
        {
            //var jumpPointY = rc.position;
            if (Input.anyKey && CheckGround())
            {
                //isDown = true;
                // rigbady의 혹시 모를 힘을 죽인다.
                rc.velocity        = Vector3.zero;
                rc.angularVelocity = Vector3.zero;
                rc.Sleep();

                JumpPoint   = rc.velocity + Vector3.up * 7f;
                rc.velocity = JumpPoint;

                //gauge.fillAmount = 0f;
                soundManager.SoundPlay((int)AudioClipName.Jump);
                //StartCoroutine(GuageProgressDown());
            }
            //else if (Input.GetMouseButtonUp(0) && CheckGround())
            //{
            //    //isDown = false;
            //    //if (gauge.fillAmount > 0.5f)
            //    //    jumpSpeed = 7f;
            //    //else
            //    //    jumpSpeed = 6f;
            //}
        }
コード例 #2
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Star") == true)
        {
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else
        {
            var tmpCheckColor = other.transform.GetComponent <Renderer>().material.color;
            Debug.LogFormat("tmpColor = " + tmpCheckColor.ToString() + "okColor = " + spwanManger.Ok.ToString());
            if (spwanManger.Ok == tmpCheckColor)
            {
                combo.ScoreUp(10);
                sm.SoundPlay((int)MJ.AudioClipName.Item);
                //lbj.SpwanManager.count++;
                Destroy(other.gameObject);
            }
            else
            {
                lbj.SpwanManager.isSpwan = false;

                manager.GameOver();
                DestroyAllOBJ();
                Destroy(other.gameObject);
            }
        }

        //if (other.gameObject.tag == "Enemy") // 에너미 태그가 ok
        //{
        //    combo.ScoreUp(10);
        //    sm.SoundPlay((int)MJ.AudioClipName.Item);
        //    //lbj.SpwanManager.count++;
        //    Destroy(other.gameObject);
        //}

        //if (other.gameObject.tag == "Coin") //코인 테그가 No
        //{
        //    //Destroy(other.gameObject);
        //    lbj.SpwanManager.isSpwan = false;

        //    manager.GameOver();
        //    DestroyAllOBJ();
        //    Destroy(other.gameObject);
        //}
    }
コード例 #3
0
        public void CheckPlayerJumping()
        {
            lineControll.springJoint.spring = 15f;
            Jump.jumping = false;
            jump.JumpStart();
            soundManager.SoundPlay((int)AudioClipName.Jump);
            //gameManager.ScoreUpdate(((int)(tlc.transform.position.y * 10)));
            //GameIconManger.UpShow();

            lineControll.LineSpringForce(tlc.topTr);
        }
コード例 #4
0
        private void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.tag == "Enemy")
            {
                Debug.Log("Enter Trigger");
                gameManager.ScoreUp();

                var tmpGameobject = new GameObject();
                var tmp           = other.transform.position;
                tmpGameobject.transform.position = tmp;
                Instantiate(particle, tmpGameobject.transform, false);
                Destroy(tmpGameobject, 1f);

                soundManager.SoundPlay((int)AudioClipName.Punch);

                Destroy(other.gameObject);
            }
        }
コード例 #5
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Enemy")
        {
            //Destroy(other.gameObject);
            DestroyAllOBJ();
            manager.GameOver();
            lbj.SpwanManager.isSpwan = false;
        }

        if (other.gameObject.tag == "Coin")
        {
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            //Destroy(other.gameObject);
            //lbj.SpwanManager.count++;
        }
        Destroy(other.gameObject);
    }
コード例 #6
0
    // Update is called once per frame
    private void Update()
    {
        //cooltime += Time.deltaTime;
        if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
        {
#if UNITY_EDITOR
            if (!EventSystem.current.IsPointerOverGameObject()
#else
            if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)
#endif
                && Input.GetMouseButtonDown(0) && trggerDelay == false && Time.timeScale == 1)
            {
                //cooltime = 0;
                trggerDelay = true;
                GameObject arrow     = Instantiate(arrowPrefab, bowPos.position, bowPos.rotation);
                Rigidbody  rb        = arrow.GetComponent <Rigidbody>();
                var        tmpScript = arrow.GetComponent <DestroyByStar>();
                tmpScript.Tagets = Tagetnames;
                rb.AddForce(bowPos.up * throwForce, ForceMode.VelocityChange);
                sm.SoundPlay((int)MJ.AudioClipName.Bow);
            }
        }
    }
コード例 #7
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Enemy" || other.tag == "Star")
        {
            return;
        }

        if (other.tag == "Player" || other.tag == "Border")
        {
            //Destroy(other.transform.gameObject);
            manager.GameOver();
            Destroy(gameObject);
        }

        if (other.tag == "Bullet")
        {
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Hit);
            blood.Play();
            StartCoroutine(DelayDead());
            //Destroy(other.transform.gameObject);
        }
    }
コード例 #8
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == ("Player1_item(Clone)"))
        {
            itemNum = 2;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.name == ("Player3_item(Clone)"))
        {
            itemNum = 3;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.name == ("Player4_item(Clone)"))
        {
            itemNum = 4;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.name == ("Player5_item(Clone)"))
        {
            itemNum = 5;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.name == ("Player6_item(Clone)"))
        {
            itemNum = 6;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.name == ("Player7_item(Clone)"))
        {
            itemNum = 7;
            manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }
        else if (other.tag == "Minus")
        {
            if (tailObjects.Count == 1)
            {
                combo.ScoreUp(10);
                Destroy(other.gameObject);
                return;
            }
            Destroy(tailObjects[tailObjects.Count - 1]);
            tailObjects.RemoveAt(tailObjects.Count - 1);

            //manager.AddTail();
            combo.ScoreUp(10);
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            Destroy(other.gameObject);
        }

        if (other.CompareTag("Border"))
        {
            manager.GameOver();
        }

        if (other.CompareTag("Enemy"))
        {
            if (other.GetComponent <TailMovement>().index > 2)
            {
                manager.GameOver();
            }
        }
    }
コード例 #9
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Enemy" || other.tag == "Star")
        {
            return;
        }

        if (other.tag == "Player" || other.tag == "Bullet" || other.tag == "Box")
        {
            comboText.GetComponentInParent <Canvas>().enabled = true;
            sm.SoundPlay((int)MJ.AudioClipName.Item);
            //Destroy(gameObject);
            if (gameObject.name == "RedStar(Clone)")
            {
                combo.redCnt++;
                combo.yellowCnt = 0;
                combo.greenCnt  = 0;
                comboText.text  = combo.redCnt.ToString() + "Combo!";
                StartCoroutine(ShowCombo());
                combo.ScoreUp(score * combo.redCnt);
            }
            else if (gameObject.name == "YellowStar(Clone)")
            {
                combo.yellowCnt++;
                combo.redCnt   = 0;
                combo.greenCnt = 0;
                comboText.text = combo.yellowCnt.ToString() + "Combo!";
                StartCoroutine(ShowCombo());
                combo.ScoreUp(score * combo.yellowCnt);
            }
            else if (gameObject.name == "GreenStar(Clone)")
            {
                combo.greenCnt++;
                combo.yellowCnt = 0;
                combo.redCnt    = 0;
                comboText.text  = combo.greenCnt.ToString() + "Combo!";
                StartCoroutine(ShowCombo());
                combo.ScoreUp(score * combo.greenCnt);
            }
            else if (gameObject.name == "RainbowStar(Clone)")
            {
                if (combo.redCnt > 0 && combo.yellowCnt == 0 && combo.greenCnt == 0)
                {
                    combo.redCnt++;
                    comboText.text = combo.redCnt.ToString() + "Combo!";
                    StartCoroutine(ShowCombo());
                    combo.ScoreUp(score * combo.redCnt);
                }
                else if (combo.yellowCnt > 0 && combo.redCnt == 0 && combo.greenCnt == 0)
                {
                    combo.yellowCnt++;
                    comboText.text = combo.yellowCnt.ToString() + "Combo!";
                    StartCoroutine(ShowCombo());
                    combo.ScoreUp(score * combo.yellowCnt);
                }
                else if (combo.greenCnt > 0 && combo.yellowCnt == 0 && combo.redCnt == 0)
                {
                    combo.greenCnt++;
                    comboText.text = combo.greenCnt.ToString() + "Combo!";
                    StartCoroutine(ShowCombo());
                    combo.ScoreUp(score * combo.greenCnt);
                }
                else
                {
                    StartCoroutine(ShowCombo());
                    combo.ScoreUp(score);
                }
            }
        }
        //Destroy(gameObject);
    }