Exemplo n.º 1
0
    //Vector3 RandomPos()
    //{
    //	int x, y, z;
    //	x = Random.Range(-2, 2);
    //	y = Random.Range(-1, 1);
    //	z = Random.Range(0, 0);
    //	return new Vector3(x, y, z);
    //}

    public void BackToMenu()
    {
        SoundManager_Script.Play_SFX("MenuNavPop");
        SoundManager_Script.Stop_BG_SFX();
        //LoadingScreen.SetActive(true);
        Time.timeScale = 1f;
        SVM_Script.Instance.LoadLevel("MainScene");
    }
Exemplo n.º 2
0
 public void InstantiateParticleWin()
 {
     SoundManager_Script.Play_SFX("CorrectAnswer");
     tempParticle = Instantiate(winParticle, this.transform.position, Quaternion.identity) as GameObject;
     tempParticle = Instantiate(scoreUpParticle, scoreChangeSpritePos, Quaternion.identity) as GameObject;
     tempParticle.GetComponent <ScoreModifierSprite>().SetNumber(scoreValue, true, false, false);
     Invoke("DestroyInstantiate", 0.1f);
 }
Exemplo n.º 3
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Ball3D"))
        {
            //Vector3.Distance(transform.eulerAngles, new Vector3(90,270,0)) > 5.0f

            SM_Script.Play_SFX(other.gameObject.GetComponent <Ball3D> ().value);
            GM_Script.DisplayRecallNumbers(other.gameObject.GetComponent <Ball3D> ().value);
            BM_Script.DisplayGameNumbers(other.gameObject);
            BM_Script.BallStoppedMoving();

            if (BM_Script.NoBallsMoving())
            {
                GM_Script.menuLock = false;
            }
        }
    }
Exemplo n.º 4
0
    //public void ResetClaw(){
    //this.transform.localPosition = originalClawPos;
    //}

    void OnTriggerEnter(Collider other)
    {
        if (!retracting)
        {
            retracting = true;
            SoundManager_Script.Play_BG_SFX("reelbackheavy");                   //this is the sound for reeling back the rod

            GetOrigin();
            //target = origin.position;
            //target = retractOrigin;
            gunScript.CallRotateBackRod();
            if (other.gameObject.CompareTag("balls"))
            {
                SoundManager_Script.Play_SFX("hit");                 // this plays when the claw hits  an object
                //Debug.Log ("Hit");

                hitBall     = true;
                childObject = other.gameObject;
                SM_Script.playerAnswerInSM = childObject.GetComponent <BallScript>().points;
                if (SM_Script.VerifyAnswer())
                {
                    //SoundManager_Script.Play_SFX("correct");
                    BeeM_Script.SpawnBees(other.gameObject);
                }
                other.transform.SetParent(this.transform);
            }
            else if (other.gameObject.CompareTag("collectibles"))
            {
                SoundManager_Script.Play_SFX("hit");                 // this plays when the claw hits an object
                hitCollectibles = true;
                childObject     = other.gameObject;
                other.gameObject.GetComponent <CollectiblesScript>().isCollected = true;
                other.transform.SetParent(this.transform);
            }
            else if (other.gameObject.CompareTag("AngryBee"))
            {
                SoundManager_Script.Play_SFX("hit");                 // this plays when the claw hits an object
                hitAngryBee = true;
                other.gameObject.GetComponent <AngryBee_Script>().isCollected = true;
                other.transform.SetParent(this.transform);
                childObject = other.gameObject;
            }
        }
    }
Exemplo n.º 5
0
 /// <summary>
 /// Raises the mouse down event.
 /// </summary>
 public virtual void OnMouseDown()
 {
     //if(Input.GetMouseButtonDown(0))
     //{
     SM_Script.Play_SFX("splat");
     if (ScoreManager_Script.EditScore(value, ScoreManagerScript.ScoreSource.Bee))
     {
         GameObject.Instantiate(particlePrefab, this.transform.position, this.transform.rotation);
         GameObject tempScoreParticle = GameObject.Instantiate(ScoreNumberPrefab, this.transform.position, Quaternion.identity) as GameObject;
         tempScoreParticle.GetComponent <ScoreModifierSprite>().SetNumber(value, true, true, false);
     }
     Kill();
     //}
 }
Exemplo n.º 6
0
 /// <summary>
 /// Raises the mouse down event.
 /// </summary>
 public void OnMouseDown()
 {
     SM_Script.Play_SFX("splat");
     if (ScoreManager_Script.CheckBeeAnswer(value))
     {
         Instantiate(particlePrefab, this.transform.position, this.transform.rotation);             //Need to complete the following lines based on the Agreed Upon value for the Bonus Round bees
         ScoreManager_Script.EditScore(1, ScoreManagerScript.ScoreSource.BonusBee);
         GameObject tempScoreParticle = Instantiate(scoreNumberPrefab, this.transform.position, Quaternion.identity) as GameObject;
         tempScoreParticle.GetComponent <ScoreModifierSprite>().SetNumber(1, true, true, false);
     }
     else
     {
         //Reduce the time remaining or something like that here
         BeeM.ReduceTime();
         GameObject tempScoreParticle = Instantiate(scoreNumberPrefab, this.transform.position, Quaternion.identity) as GameObject;
         tempScoreParticle.GetComponent <ScoreModifierSprite>().SetNumber(1, true, true, true);
     }
     Kill();
 }
Exemplo n.º 7
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     Debug.Log("Collision2D");
     if (collision.gameObject.tag == "Player")
     {
         SM_Script.Play_SFX("STEEL BARREL NO.1");
         if (GM_Script.isGerryCanAvailable == true)
         {
             Instantiate(smokeBubble, transform.localPosition, Quaternion.identity);
             GM_Script.isGerryCanAvailable = false;
             QM_Script.InvokeQuestion();
             Destroy(this.gameObject);
         }
     }
     else if (collision.gameObject.tag == "DeadZone")
     {
         DestroyGerryCan();
     }
 }
Exemplo n.º 8
0
    /*private bool isRenderFrame;
     * public void WillRenderObject()
     * {
     *
     *
     *      if(!isShooting)
     *      {
     *              line.SetVertexCount(2);
     *              line.SetPosition(0, this.gameObject.transform.position);
     *              //line.SetPosition(1,  rayHit.point);
     *              line.SetPosition(1,  lineEndPos.transform.position);
     *              //line.SetPosition(2, transform.localPosition);
     *              line.SetWidth(0.01f, 0.01f);
     *      }
     *      else
     *      {
     *              line.SetVertexCount(0);
     *      }
     *
     * }*/

    public void CastClaw()
    {
        if (!isShooting && canShoot)
        {
            if (!GM1_Script.gameIsPaused)
            {
                SoundManager_Script.Play_SFX("cast");
                //Debug.Log("ttttt");

                //panelInstructionsOff=true;
                isRotatingRod = true;
                isShooting    = true;

                //clawScript.GetOrigin();
                shooterAnimator.speed = 0;
                StartCoroutine(RotateFishingRod());
                //Debug.Log ("dsdsds");
            }
        }
    }
Exemplo n.º 9
0
 public void OnMouseOver()
 {
     if (Input.GetMouseButtonDown(0))
     {
         SM_Script.Play_SFX("twigsnap");
         GameObject.Instantiate(twigParticlePrefab, this.transform.position, this.transform.rotation);
         tempLifeNum++;
         if (tempLifeNum < lifeTest)
         {
             transform.localScale -= new Vector3(0.06f, 0.06f, 0.06f);
         }
         else
         {
             if (ScoreManager_Script.EditScore(tempValue, ScoreManagerScript.ScoreSource.BackGroundObj))
             {
                 GameObject tempScoreParticle = GameObject.Instantiate(scoreChangePrefab, this.transform.position, Quaternion.identity) as GameObject;
                 tempScoreParticle.GetComponent <ScoreModifierSprite>().SetNumber(tempValue, true, true, false);
             }
             Destroy(this.gameObject);
         }
     }
 }
Exemplo n.º 10
0
    //Toggle campaign sprite when clicked



    public void DisablePanel(GameObject parentPanel)
    {
        SoundManager_Script.Play_SFX("MenuNav2");

        parentPanel.SetActive(false);
    }