Esempio n. 1
0
    protected override void ExitNexus(CharacterMotor motor) //JANK naming scheme (Note: motor.ExitNexus())
    {
        //TODO: check if function is complete
        motor.ExitNexus();

        CollisionDetector detector = motor.GetComponent <CollisionDetector>();

        detector.Activate();
        optional <ArcOfSphere> closest_arc = detector.BalloonCast(motor.current_position, motor.radius + 0.01f); //FIXME: magic number

        if (!closest_arc.exists)
        {
            Debug.Log("Something is very wrong here");
        }
        motor.Traverse(closest_arc.data, closest_arc.data.ClosestPoint(motor.current_position));

        Destroy(this.gameObject);
    }