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); } }
//activated from the node class public void StartPreparingMoveAway() { //stop all coroutines, so that it no longer rotates, or moves to its old target StopAllCoroutines(); //let the ball move to its owner, once its done, we activate the MoveAway function when its done returning with a delegate connectionEffect = GetComponent <ConnectionEffect>(); connectionEffect.ConnectionIsFinished += MoveAway; connectionEffect.FinishConnection(); }