Example #1
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (Launched)
        {
            StarSound.PlayOneShot(StarSound.clip);
            //Debug.Log(Launched);

            //Debug.Log(collision.transform.name);

            GameObject effect = Instantiate(Resources.Load(EFFECT_PATH)) as GameObject;
            effect.transform.position = (Vector3)collision.transform.position;

            scoreData.AddScoreCoefficient(AddNumber);
            //Debug.Log(collision.transform.name);
        }

        //gameObject.GetComponent<SpriteRenderer>().enabled = false;
        gameObject.GetComponent <CircleCollider2D>().enabled = false;
        MainSpriteRenderer.enabled  = false;
        ChildSpriteRenderer.enabled = false;

        //GameObject.Destroy(gameObject);
    }