Ejemplo n.º 1
0
    public void setParticleCollision()
    {
        ParticleSystem ps;

        if (cube.gameObject.activeInHierarchy)
        {
            ps = cube.GetComponent <ParticleSystem>();
        }
        else
        {
            ps = sphere.GetComponent <ParticleSystem>();
        }

        ps.gravityModifier = 1;

        ParticleSystem.ColorOverLifetimeModule colorOverLT = ps.colorOverLifetime;
        colorOverLT.enabled = true;
        colorOverLT.color   = colorOverLifeTiime;

        ParticleSystem.CollisionModule col = ps.collision;
        col.enabled = true;
        col.dampen  = 0.2f;
        col.bounce  = 1;

        ps.Clear();
    }
    public void ChangeParticleColor()
    {
        Color c = Random.ColorHSV(0f, 1f, 0f, 1f, 0f, 1f, 1f, 1f);

        cube.GetComponent <ParticleSystem>().startColor   = c;
        sphere.GetComponent <ParticleSystem>().startColor = c;
    }
Ejemplo n.º 3
0
	IEnumerator Transporter(Transform Ball)
	{
		yield return new WaitForSeconds(0.75f);
		Ball.SetParent(ExitTeleport.GetComponent<Teleport>().Node.transform);
		Ball.position = ExitTeleport.transform.position;
		Ball.GetComponent<Ball>().AlignmentBall();
	}
Ejemplo n.º 4
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision is CircleCollider2D)
        {
            return;
        }
        if (_nowWarp)
        {
            return;
        }
        // _pair의 boxCollider2D를 enabled , false로
        _pair.GetComponent <BoxCollider2D>().enabled = false;

        if (Vector2.Distance(transform.position, collision.transform.position) > 0.2f)
        {
            StartCoroutine(Warp());

            // StartCoroutine(ObjectWarp());
        }
    }