Exemple #1
0
    //bool fadeVolume = false;


    // Use this for initialization
    void Start()
    {
        CM       = GetComponent <CanvasManip>();
        TR       = GetComponent <target_random>();
        puckFade = 100;
        GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 1);
    }
Exemple #2
0
 void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.collider.tag == "limbs" && activeScore && puckFade > 99)
     {
         //GetComponent<CanvasManip>().scoreAmount += 1;
         Debug.Log("ajshdsajkmhdjksahdkjsa");
         CM              = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasManip>();
         CM.scoreAmount += 1;
         activeScore     = false;
     }
 }
Exemple #3
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        if (GameObject.FindGameObjectWithTag("targetti") != null)
        {
            if (coll.collider.tag == "limbsR" && activeScore && puckFade > 99.0f)
            {
                TR              = GameObject.FindGameObjectWithTag("targetti").GetComponent <target_random>();
                CM              = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasManip>();
                CM.scoreAmount += 1;

                //TR.isUpRep();


                // Only score as completed rep on upRep
                if (GameControl.instance.isUpRep)
                {
                    CM.scoreRight += 1;
                }
                else
                {
                    Debug.Log("NO REP!");
                }

                //Debug.Log("UpRep: " + GameControl.instance.isUpRepLeft);
                GameControl.instance.completedRepsLeft = CM.scoreRight;            // Note: Arms are mirrored

                StartCoroutine(playGoalSaveSounds());

                GameObject fx = Instantiate(BowEffect) as GameObject;
                fx.transform.position = transform.position;
                activeScore           = false;


                TR.pointColor = new Color32(0x01, 0x75, 0xC8, 0xFF);
                GameObject point = Instantiate(TR.puckpoint) as GameObject;                                                     //Adds an indicator object to score meter
                point.transform.position = new Vector2(TR.meter.transform.position.x + 0f, TR.meter.transform.position.y + 6f); //Gives the position to indicator object
                point.GetComponent <SpriteRenderer>().color = TR.pointColor;                                                    //0175C8
            }


            if (coll.collider.tag == "limbsL" && activeScore && puckFade > 99.0f)
            {
                TR              = GameObject.FindGameObjectWithTag("targetti").GetComponent <target_random>();
                CM              = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasManip>();
                CM.scoreAmount += 1;

                //TR.isUpRep();

                // Only score as completed rep on upRep
                if (GameControl.instance.isUpRep)
                {
                    CM.scoreLeft += 1;
                }
                else
                {
                    Debug.Log("NO REP!");
                }

                GameControl.instance.completedRepsRight = CM.scoreLeft;

                StartCoroutine(playGoalSaveSounds());

                GameObject fx = Instantiate(BowEffect) as GameObject;
                fx.transform.position = transform.position;
                activeScore           = false;


                TR.pointColor = new Color32(0xFB, 0xBB, 0x01, 0xFF);
                GameObject point = Instantiate(TR.puckpoint) as GameObject;                                                     //Adds an indicator object to score meter
                point.transform.position = new Vector2(TR.meter.transform.position.x + 0f, TR.meter.transform.position.y + 6f); //Gives the position to indicator object
                point.GetComponent <SpriteRenderer>().color = TR.pointColor;                                                    //FBBB01
            }
        }


        //Debug.Log("ScoreL: " + GameControl.instance.completedRepsLeft);
        //Debug.Log("ScoreR: " + GameControl.instance.completedRepsRight);
    }