Exemplo n.º 1
0
    void CreateOrb()
    {
        if (currentProjectile)
        {
            currentProjectile.DestroyOrb();
        }

        currentProjectile = Instantiate(projectile, transform.position, Quaternion.identity);
        currentProjectile.LaunchOrb(transform.right * launchForce);
    }
    void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.CompareTag("Platform"))
        {
            GravityOrbBehaviour other = collision.GetComponent <MovePlatformBehaviour>().gravityOrb;

            if (other == orbBehaviour)
            {
                other = null;
            }
        }
    }
 void Awake()
 {
     orbBehaviour  = GetComponentInParent <GravityOrbBehaviour>();
     pointEffector = GetComponent <PointEffector2D>();
 }