Exemple #1
0
    public void StartEffect(Transform _otherOccupier)
    {
        waypointsController = ball.GetComponent <WaypointsController>();

        ignoreCollisionsBall = ball.GetComponent <IgnoreCollisions>();
        ConnectionEffect otherConnectionEffect = _otherOccupier.GetComponent <ConnectionEffect>();

        connectionActive = true;

        if (!otherConnectionEffect.connectionActive)
        {
            otherConnectionEffect.StartEffect(transform);
        }

        ignoreCollisionsBall.AddActiveCollision(otherConnectionEffect.Ball.GetComponent <Collider>());
        ignoreCollisionsBall.RemoveActiveCollision(myHead.GetComponent <Collider>());

        ball.GetComponent <RandomDirectionPush>().Executing = false;

        ball.GetComponent <ControlledBounce>().ControlBounce = false;

        //only spawn the waypoints if i am a student
        if (isStudent)
        {
            SpawnWayPoints(_otherOccupier);
        }
    }
Exemple #2
0
    void WaitingForFinishReturn()
    {
        waypointsController.FinishedReturning -= WaitingForFinishReturn;

        Destroy(ball);

        ignoreCollisionsBall.AddActiveCollision(myHead.GetComponent <Collider>());

        if (ConnectionIsFinished != null)
        {
            ConnectionIsFinished();
        }
    }